mirror of https://github.com/Xhofe/alist
💚 fix dockerfile
parent
e70353704f
commit
6275e27d1b
|
@ -1,8 +1,9 @@
|
|||
FROM golang:alpine as builder
|
||||
FROM alpine as builder
|
||||
LABEL stage=go-builder
|
||||
WORKDIR /app/
|
||||
COPY ./ ./
|
||||
RUN sh build.sh docker
|
||||
RUN apk add --no-cache bash git go=1.17.3-r0 gcc musl-dev; \
|
||||
sh build.sh docker
|
||||
|
||||
FROM alpine
|
||||
LABEL MAINTAINER="i@nn.ci"
|
||||
|
|
10
build.sh
10
build.sh
|
@ -10,13 +10,12 @@ if [ "$1" == "web" ]; then
|
|||
fi
|
||||
|
||||
if [ "$1" == "docker" ]; then
|
||||
apk add --no-cache git
|
||||
appName="alist"
|
||||
builtAt="$(date +'%F %T %z')"
|
||||
goVersion=$(go version | sed 's/go version //')
|
||||
gitAuthor=$(git show -s --format='format:%aN <%ae>' HEAD)
|
||||
gitCommit=$(git log --pretty=format:"%h" -1)
|
||||
gitTag=$(git describe --abbrev=0 --tags)
|
||||
gitTag=$(git describe --long --tags --dirty --always)
|
||||
ldflags="\
|
||||
-w -s \
|
||||
-X 'github.com/Xhofe/alist/conf.BuiltAt=$builtAt' \
|
||||
|
@ -47,12 +46,7 @@ builtAt="$(date +'%F %T %z')"
|
|||
goVersion=$(go version | sed 's/go version //')
|
||||
gitAuthor=$(git show -s --format='format:%aN <%ae>' HEAD)
|
||||
gitCommit=$(git log --pretty=format:"%h" -1)
|
||||
|
||||
if [ "$1" == "release" ]; then
|
||||
gitTag=$(git describe --abbrev=0 --tags)
|
||||
else
|
||||
gitTag=build-next
|
||||
fi
|
||||
gitTag=$(git describe --long --tags --dirty --always)
|
||||
|
||||
echo "build version: $gitTag"
|
||||
|
||||
|
|
Loading…
Reference in New Issue