19 lines
501 B
Docker

# Base image
FROM golang AS builder
# Set directory to known value
WORKDIR /app
# Define the version as a build argument
ARG GOTEMPLATE_VERSION=3.12.0
# Git clone the repo for gotemplate, checkout the desired tag, and build the executable
RUN git clone https://github.com/coveooss/gotemplate.git . && \
git checkout v${GOTEMPLATE_VERSION} && \
CGO_ENABLED=0 go build
FROM busybox
COPY --from=builder /app/gotemplate /gotemplate
COPY --from=builder /bin/cp /cp
ENTRYPOINT [ "/gotemplate" ]