-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
37 lines (28 loc) · 1.26 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
### VERSIONS METADATA ###
ARG IMAGE_VERSION=2.8.4
ARG ALPINE_VERSION=3.20
ARG GO_VERSION=1.22.5
ARG CADDY_VERSION=2.8.4
### END VERSIONS METADATA ###
# Build binary with plugins
FROM golang:${GO_VERSION}-alpine${ALPINE_VERSION} AS builder
WORKDIR /tmp
RUN apk --no-cache add ca-certificates make git && update-ca-certificates
RUN git clone "https://github.com/caddyserver/caddy.git"
WORKDIR /tmp/caddy/cmd/caddy
RUN go install github.com/caddyserver/xcaddy/cmd/xcaddy@latest
RUN xcaddy build \
--with github.com/caddy-dns/digitalocean@master \
--with github.com/mholt/caddy-l4 \
--output /usr/bin/caddy
# Build clear image
FROM caddy:${CADDY_VERSION}-alpine AS caddy
ARG IMAGE_VERSION
LABEL org.opencontainers.image.description "This image contains a caddy with dns plugin https://github.com/caddy-dns/digitalocean"
LABEL org.opencontainers.image.url https://github.com/obervinov/images/docker/caddy
LABEL org.opencontainers.image.documentation https://github.com/obervinov/images/docker/caddy/README.md
LABEL org.opencontainers.image.authors https://github.com/obervinov
LABEL org.opencontainers.image.source https://github.com/obervinov/images
LABEL org.opencontainers.image.version ${IMAGE_VERSION}
RUN apk -U upgrade
COPY --from=builder /usr/bin/caddy /usr/bin/caddy