diff --git a/.gitignore b/.gitignore index 656adfe..d876f0a 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,5 @@ luxshare-daily-report *.yml .DS_Store + +app* diff --git a/Dockerfile b/Dockerfile index ed003f5..09cd838 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,7 @@ FROM alpine:latest +ARG TARGETARCH + RUN mkdir "/app" WORKDIR "/app" @@ -13,8 +15,10 @@ RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime RUN echo "Asia/Shanghai" > /etc/timezone -COPY luxshare-daily-report "/app/luxshare-daily-report" +COPY app* "/app/." + +RUN mv app_${TARGETARCH} app EXPOSE 7201 -ENTRYPOINT ["./luxshare-daily-report"] \ No newline at end of file +ENTRYPOINT ["./app"] \ No newline at end of file diff --git a/build b/build index a56ad96..c36fe83 100755 --- a/build +++ b/build @@ -1 +1,3 @@ -CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-s -w" . \ No newline at end of file +CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o app_amd64 -ldflags="-s -w" + +CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -o app_arm64 -ldflags="-s -w" \ No newline at end of file