From 1266b3f9db0346a2f029670f060ec4ac04fcb148 Mon Sep 17 00:00:00 2001 From: dushixiang Date: Sun, 6 Mar 2022 15:43:38 +0800 Subject: [PATCH] =?UTF-8?q?Docker=20=E6=89=93=E5=8C=85=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20upx=20=E5=8E=8B=E7=BC=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index a6f791d..e2263c9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,12 +9,13 @@ WORKDIR /app COPY . . RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories -RUN apk add gcc g++ +RUN apk add gcc g++ 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 upx next-terminal FROM alpine:latest