Update Dockerfile to build properly

Credit goes to iamcgn at https://www.reddit.com/r/docker/comments/mh35w3/architecture_issue_with_running_a_docker_project/ for creating this Dockerfile.
This commit is contained in:
Nick
2021-04-01 22:20:17 +01:00
committed by GitHub
parent 7d430f581e
commit 65106da6f7

View File

@@ -10,12 +10,12 @@ RUN go mod download
COPY . .
RUN rice embed-go
RUN CGO_ENABLED=0 go build -o boringproxy
RUN chmod +x boringproxy
FROM scratch
RUN cd cmd/boringproxy && CGO_ENABLED=0 go build -o boringproxy
FROM scratch
EXPOSE 80 443
COPY --from=builder /build/boringproxy /
COPY --from=builder /build/cmd/boringproxy/boringproxy /
ENTRYPOINT ["/boringproxy"]
CMD ["server"]