From 16f73945c3cc23b8a5a6fc3214d15aadef4dd458 Mon Sep 17 00:00:00 2001 From: dushixiang Date: Tue, 8 Mar 2022 21:55:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9docker=E6=89=93=E5=8C=85?= =?UTF-8?q?=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index e2263c9..4d3bdb1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,12 +9,12 @@ WORKDIR /app COPY . . RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories -RUN apk add gcc g++ upx +RUN apk add upx RUN go mod tidy RUN sh get_arch.sh RUN echo "Hello, my CPU architecture is $(uname -m)" RUN cp -r /app/web/build /app/server/resource/ -RUN go env;CGO_ENABLED=1 GOOS=linux GOARCH=$ARCH go build -a -ldflags '-linkmode external -extldflags "-static"' -o next-terminal main.go +RUN go env;CGO_ENABLED=0 GOOS=linux GOARCH=$ARCH go build -ldflags '-s -w' -o next-terminal main.go RUN upx next-terminal FROM alpine:latest @@ -36,7 +36,6 @@ RUN touch config.yml COPY --from=builder /app/next-terminal ./ COPY --from=builder /app/LICENSE ./ -#COPY --from=builder /app/web/build ./web/build EXPOSE $SERVER_PORT $SSHD_PORT