create writable dir in the docker image
This commit is contained in:
parent
0300b0b4f0
commit
c59ded962b
|
@ -7,10 +7,12 @@ COPY . .
|
||||||
RUN CGO_ENABLED=0 go build -a -tags netgo -ldflags '-s -w -extldflags "-static" -X main.version='"$GIT_DESC"
|
RUN CGO_ENABLED=0 go build -a -tags netgo -ldflags '-s -w -extldflags "-static" -X main.version='"$GIT_DESC"
|
||||||
ADD https://curl.haxx.se/ca/cacert.pem /certs.crt
|
ADD https://curl.haxx.se/ca/cacert.pem /certs.crt
|
||||||
RUN chmod 0644 /certs.crt
|
RUN chmod 0644 /certs.crt
|
||||||
|
RUN mkdir /.dumbproxy
|
||||||
|
|
||||||
FROM scratch AS scratch
|
FROM scratch AS scratch
|
||||||
COPY --from=build /go/src/github.com/Snawoot/dumbproxy/dumbproxy /
|
COPY --from=build /go/src/github.com/Snawoot/dumbproxy/dumbproxy /
|
||||||
COPY --from=build /certs.crt /etc/ssl/certs/ca-certificates.crt
|
COPY --from=build /certs.crt /etc/ssl/certs/ca-certificates.crt
|
||||||
|
COPY --from=build --chown=9999:9999 /.dumbproxy /.dumbproxy
|
||||||
USER 9999:9999
|
USER 9999:9999
|
||||||
EXPOSE 8080/tcp
|
EXPOSE 8080/tcp
|
||||||
ENTRYPOINT ["/dumbproxy", "-bind-address", ":8080"]
|
ENTRYPOINT ["/dumbproxy", "-bind-address", ":8080"]
|
||||||
|
@ -18,6 +20,7 @@ ENTRYPOINT ["/dumbproxy", "-bind-address", ":8080"]
|
||||||
FROM alpine AS alpine
|
FROM alpine AS alpine
|
||||||
COPY --from=build /go/src/github.com/Snawoot/dumbproxy/dumbproxy /
|
COPY --from=build /go/src/github.com/Snawoot/dumbproxy/dumbproxy /
|
||||||
COPY --from=build /certs.crt /etc/ssl/certs/ca-certificates.crt
|
COPY --from=build /certs.crt /etc/ssl/certs/ca-certificates.crt
|
||||||
|
COPY --from=build --chown=9999:9999 /.dumbproxy /.dumbproxy
|
||||||
USER 9999:9999
|
USER 9999:9999
|
||||||
EXPOSE 8080/tcp
|
EXPOSE 8080/tcp
|
||||||
ENTRYPOINT ["/dumbproxy", "-bind-address", ":8080"]
|
ENTRYPOINT ["/dumbproxy", "-bind-address", ":8080"]
|
||||||
|
|
Loading…
Reference in New Issue