Skip to content

Commit

Permalink
fixup! Distill to single Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
hairyhenderson committed Nov 1, 2019
1 parent 9045ec2 commit e6fdde7
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,29 @@ WORKDIR /src/caddy/cmd/caddy
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 \
go build -trimpath -tags netgo -ldflags '-extldflags "-static" -s -w' -o /usr/bin/caddy

# Fetch the latest default welcome page and default Caddy config
FROM alpine:3.10.3 AS fetch-assets

RUN apk add --no-cache git

WORKDIR /src/dist
RUN git clone https://github.com/caddyserver/dist .
RUN git checkout 97bcdfccf5392c650216ebb0634a5ed4c680ad6a

RUN cp config/Caddyfile /Caddyfile
RUN cp welcome/index.html /index.html

FROM alpine:3.10.3 AS alpine

COPY build/files .
COPY docker-entrypoint.sh /docker-entrypoint.sh

COPY --from=builder /usr/bin/caddy /usr/bin/caddy
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs
COPY --from=builder /etc/passwd /etc/passwd

COPY --from=fetch-assets /Caddyfile /etc/caddy/Caddyfile
COPY --from=fetch-assets /index.html /usr/share/caddy/index.html

ARG VCS_REF
ARG VERSION
LABEL org.opencontainers.image.revision=$VCS_REF \
Expand All @@ -45,6 +59,9 @@ COPY --from=builder /usr/bin/caddy /usr/bin/caddy
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs
COPY --from=builder /etc/passwd /etc/passwd

COPY --from=fetch-assets /Caddyfile /etc/caddy/Caddyfile
COPY --from=fetch-assets /index.html /usr/share/caddy/index.html

ARG VCS_REF
ARG VERSION
LABEL org.opencontainers.image.revision=$VCS_REF \
Expand Down

0 comments on commit e6fdde7

Please sign in to comment.