feat: Improve Docker build (#3682)
This commit is contained in:
@@ -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"]
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user