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