Skip to content

Commit

Permalink
chore: simplify Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
aofei committed Mar 14, 2024
1 parent fa185c0 commit 4cce0f5
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@ WORKDIR /usr/local/src/goproxy
COPY . .

RUN set -eux; \
mkdir bin; \
if [ -d dist ]; then \
GOARCH=$(go env GOARCH); \
BUILD_DIR=dist/goproxy_linux_$GOARCH; \
[ $GOARCH == "amd64" ] && BUILD_DIR=${BUILD_DIR}_v1; \
[ $GOARCH == "arm" ] && BUILD_DIR=${BUILD_DIR}_$(go env GOARM | cut -d , -f 1); \
cp $BUILD_DIR/goproxy bin/goproxy; \
BIN_DIR=dist/goproxy_linux_$GOARCH; \
[ $GOARCH == "amd64" ] && BIN_DIR=${BIN_DIR}_v1; \
[ $GOARCH == "arm" ] && BIN_DIR=${BIN_DIR}_$(go env GOARM | cut -d , -f 1); \
cp -r $BIN_DIR bin; \
else \
apk add --no-cache git; \
go mod download; \
Expand Down

0 comments on commit 4cce0f5

Please sign in to comment.