forked from cretz/caddy-tlsconsul
-
-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathDockerfile
21 lines (18 loc) · 794 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
FROM golang:1.23 AS builder
WORKDIR /workspace
RUN echo 'package main\n\
import (\n\
caddycmd "github.com/caddyserver/caddy/v2/cmd"\n\
_ "github.com/caddyserver/caddy/v2/modules/standard"\n\
_ "github.com/pteich/caddy-tlsconsul"\n\
)\n\
func main() {\n\
caddycmd.Main()\n\
}' > main.go && \
go env -w GOPROXY="https://goproxy.io,direct" && \
go mod init caddy && go get github.com/pteich/caddy-tlsconsul@fix-lock-warning && go get github.com/caddyserver/caddy/v2@v2.8.4 && go get && \
CGO_ENABLED=0 go build -trimpath -tags netgo -ldflags '-extldflags "-static" -s -w' -o /usr/bin/caddy
FROM caddy:2
LABEL maintainer="peter.teich@gmail.com"
LABEL description="Caddy 2 with integrated TLS Consul Storage plugin"
COPY --from=builder /usr/bin/caddy /usr/bin/caddy