Update docker image build file (#2892)

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

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"]

View File

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