forked from cretz/caddy-tlsconsul
-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed Dockerfile to build with new Caddy versions
- Loading branch information
Showing
1 changed file
with
13 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,19 +3,21 @@ MAINTAINER Peter Teich <[email protected]> | |
|
||
#ENV CADDY_VERSION 0.11.5 | ||
ENV GO111MODULE=on | ||
ENV GOPROXY=https://proxy.golang.org | ||
|
||
RUN set -x \ | ||
&& apk update && apk add --no-cache --upgrade \ | ||
openssl git ca-certificates sed bash busybox | ||
|
||
RUN \ | ||
git clone https://github.com/mholt/caddy.git /src/caddy \ | ||
&& cd /src/caddy | ||
|
||
RUN sed -e "s#// This is where other plugins get plugged in (imported)#_ \"github.com/pteich/caddy-tlsconsul\"#" -i /src/caddy/caddy/caddymain/run.go | ||
|
||
WORKDIR /src/caddy/caddy | ||
RUN go run build.go -goos=linux -goarch=amd64 | ||
openssl git ca-certificates | ||
|
||
RUN cd / && mkdir caddybuild && cd caddybuild && echo $'package main\n\ | ||
import (\n\ | ||
"github.com/caddyserver/caddy/caddy/caddymain"\n\ | ||
_ "github.com/pteich/caddy-tlsconsul"\n\ | ||
)\n\ | ||
func main() {\n\ | ||
caddymain.Run()\n\ | ||
}' > main.go && \ | ||
go mod init caddy && go get github.com/caddyserver/caddy && go build | ||
|
||
FROM alpine:latest | ||
LABEL maintainer="[email protected]" | ||
|
@@ -36,7 +38,7 @@ RUN set -x \ | |
&& chmod +x /usr/local/bin/dumb-init \ | ||
&& rm -rf /tmp/* | ||
|
||
COPY --from=0 /src/caddy/caddy/caddy /bin/caddy | ||
COPY --from=0 /caddybuild/caddy /bin/caddy | ||
RUN chmod +x /bin/caddy | ||
|
||
ENTRYPOINT ["/usr/local/bin/dumb-init","/bin/caddy"] | ||
|