fix: Dockerfile build issue (#1217)

zipped-static
vvisionnn 2 years ago committed by GitHub
parent 4f6989f1b8
commit 79913a5dfa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,4 +1,4 @@
FROM golang:1.17.7-alpine as cloudreve_builder
FROM golang:1.17-alpine as cloudreve_builder
# install dependencies and build tools
@ -10,13 +10,11 @@ RUN git clone --recurse-submodules https://github.com/cloudreve/Cloudreve.git
# build frontend
WORKDIR /cloudreve_builder/Cloudreve/assets
RUN yarn install --network-timeout 1000000
RUN yarn run build
RUN yarn run build && rm -rf build/*.map
# build backend
WORKDIR /cloudreve_builder/Cloudreve
RUN go get github.com/rakyll/statik \
&& statik -src=assets/build/ -include=*.html,*.js,*.json,*.css,*.png,*.svg,*.ico -f \
&& tag_name=$(git describe --tags) \
RUN tag_name=$(git describe --tags) \
&& export COMMIT_SHA=$(git rev-parse --short HEAD) \
&& go build -a -o cloudreve -ldflags " -X 'github.com/HFO4/cloudreve/pkg/conf.BackendVersion=$tag_name' -X 'github.com/HFO4/cloudreve/pkg/conf.LastCommit=$COMMIT_SHA'"

Loading…
Cancel
Save