22 lines
570 B
Docker
Raw Permalink Normal View History

2025-02-12 10:09:13 +01:00
# Base image
FROM golang:tip-alpine3.21 AS builder
2025-02-12 10:09:13 +01:00
# Set directory to known value
WORKDIR /app
# Define the version as a build argument
ARG GOTEMPLATE_VERSION=3.12.0
RUN apk add valkey-cli git
2025-02-12 10:09:13 +01:00
# 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 alpine:3.21
#
2025-02-12 10:09:13 +01:00
COPY --from=builder /app/gotemplate /gotemplate
COPY --from=builder /usr/bin/valkey-cli /valkey-cli
2025-02-12 10:09:13 +01:00
ENTRYPOINT [ "/gotemplate" ]