support build branches other than master

This commit is contained in:
LazyDBA247-Anyvision 2020-12-15 14:07:13 +02:00
parent 3c7f9633eb
commit 2ac31da89e
2 changed files with 4 additions and 0 deletions

View file

@ -2,6 +2,8 @@ FROM frolvlad/alpine-glibc as builder
RUN apk add git go g++
RUN mkdir -p /go/src/github.com/chrislusf/
RUN git clone https://github.com/chrislusf/seaweedfs /go/src/github.com/chrislusf/seaweedfs
ARG branch=${branch:-master}
RUN cd /go/src/github.com/chrislusf/seaweedfs && git checkout $ARG
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}"

View file

@ -2,6 +2,8 @@ FROM frolvlad/alpine-glibc as builder
RUN apk add git go g++
RUN mkdir -p /go/src/github.com/chrislusf/
RUN git clone https://github.com/chrislusf/seaweedfs /go/src/github.com/chrislusf/seaweedfs
ARG branch=${branch:-master}
RUN cd /go/src/github.com/chrislusf/seaweedfs && git checkout $ARG
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 -tags 5BytesOffset -ldflags "${LDFLAGS}"