Update docker image build file (#2892)

* update docker image building
This commit is contained in:
蓝云Reyes authored and GitHub committed 2022-04-29 01:12:07 +08:00
1 parent 6c658586f6
commit 44eb513f05
3 files changed
+58 -85

No files matched your search

+11 -8
View File
@@ -1,14 +1,17 @@
FROM alpine:3 AS temp
FROM golang:1.18-alpine3.15 AS building
COPY bin/frpc /tmp
COPY . /building
WORKDIR /building
RUN chmod -R 777 /tmp/frpc
RUN apk --no-cache add \
git \
&& export GO111MODULE=on \
&& env CGO_ENABLED=0 go build -trimpath -ldflags "-s -w" -o ./bin/frpc ./cmd/frpc
FROM alpine:3.15
LABEL maintainer="i@muir.fun"
FROM alpine:3
WORKDIR /app
COPY --from=temp /tmp/frpc /usr/bin
COPY --from=building /building/bin/frpc /usr/bin/frpc
ENTRYPOINT ["/usr/bin/frpc"]
CMD ["-h"]