mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-11-08 03:04:45 +08:00
build static binary in docker images
fix https://github.com/chrislusf/seaweedfs/issues/1856
This commit is contained in:
@@ -6,7 +6,7 @@ ARG BRANCH=${BRANCH:-master}
|
||||
RUN cd /go/src/github.com/chrislusf/seaweedfs && git checkout $BRANCH
|
||||
RUN cd /go/src/github.com/chrislusf/seaweedfs/weed \
|
||||
&& export LDFLAGS="-X github.com/chrislusf/seaweedfs/weed/util.COMMIT=$(git rev-parse --short HEAD)" \
|
||||
&& go install -ldflags "${LDFLAGS}"
|
||||
&& CGO_ENABLED=0 go install -ldflags "-extldflags -static ${LDFLAGS}"
|
||||
|
||||
FROM alpine AS final
|
||||
LABEL author="Chris Lu"
|
||||
|
||||
Reference in New Issue
Block a user