I am building a Docker image to create a custom Caddy server with specific modules. Here is my Dockerfile:
FROM golang:1.21.3-alpine as builder
ARG TARGETOS
ARG TARGETPLATFORM
ARG TARGETARCH
ARG CADDY_VERSION="v2.7.6"
ENV CADDY_VERSION=$CADDY_VERSION
RUN echo "Building Caddy $CADDY_VERSION for $TARGETOS"
WORKDIR /workspace
RUN go install github.com/caddyserver/xcaddy/cmd/xcaddy@latest
RUN GOOS=$TARGETOS GOARCH=$TARGETARCH xcaddy build \
--with github.com/abiosoft/caddy-yaml \
--with github.com/mholt/caddy-l4 \
--with github.com/ss098/certmagic-s3
FROM alpine
COPY --from=builder /workspace/caddy /bin/caddy
ENTRYPOINT ["/bin/caddy"]
My question is: Are the modules installed from their main/master branches, or do the versions of each module depend on the Caddy version being used? I want my Dockerfile to specify exact versions for each module included in the Caddy build.
Regards