feat: Improve Docker build (#3682)

This commit is contained in:
Rene Leonhardt
2024-03-02 16:40:31 +01:00
committed by GitHub
parent be7f93924a
commit b53ba76a99
9 changed files with 48 additions and 21 deletions

View File

@@ -1,12 +1,11 @@
FROM golang:1.19
FROM golang:1.21-alpine
ENV TZ Asia/Shanghai
ENV GOPROXY https://goproxy.cn,direct
WORKDIR /app
ADD goctl /usr/bin/goctl
ADD cmd.sh .
COPY goctl /usr/bin/
COPY cmd.sh .
RUN chmod +x /usr/bin/goctl
RUN chmod +x cmd.sh
RUN chmod +x /usr/bin/goctl cmd.sh
CMD ["/bin/bash", "cmd.sh"]

View File

@@ -25,7 +25,7 @@ fi
# run docker image
console_step "docker running"
docker run $image
docker run --rm $image
if [ $? -ne 0 ]; then
rm -f $buildFile
console_red "docker run failed"