mirror of
https://github.com/hrfee/jfa-go.git
synced 2024-12-22 17:10:10 +00:00
Fix docker build, add GOBINARY flag for make
GOBINARY defaults to "go", but if you want to build on a normal system, you'll likely set it to go1.16rc1 with "make all GOBINARY=go1.16rc1".
This commit is contained in:
parent
ee37588959
commit
98a9e20cc0
@ -45,10 +45,6 @@ archives:
|
|||||||
linux: Linux
|
linux: Linux
|
||||||
windows: Windows
|
windows: Windows
|
||||||
amd64: x86_64
|
amd64: x86_64
|
||||||
files:
|
|
||||||
- data/*
|
|
||||||
- data/**/*
|
|
||||||
- data/**/**/*
|
|
||||||
checksum:
|
checksum:
|
||||||
name_template: 'checksums.txt'
|
name_template: 'checksums.txt'
|
||||||
snapshot:
|
snapshot:
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
FROM golang:latest AS build
|
FROM golang:1.16rc1-buster AS build
|
||||||
|
|
||||||
COPY . /opt/build
|
COPY . /opt/build
|
||||||
|
|
||||||
@ -6,10 +6,10 @@ RUN apt update -y \
|
|||||||
&& apt install build-essential python3-pip curl software-properties-common sed upx -y \
|
&& apt install build-essential python3-pip curl software-properties-common sed upx -y \
|
||||||
&& (curl -sL https://deb.nodesource.com/setup_14.x | bash -) \
|
&& (curl -sL https://deb.nodesource.com/setup_14.x | bash -) \
|
||||||
&& apt install nodejs \
|
&& apt install nodejs \
|
||||||
&& (cd /opt/build; make all GOESBUILD=on; make compress) \
|
&& (cd /opt/build; make all-external GOESBUILD=on; make compress) \
|
||||||
&& sed -i 's#id="password_resets-watch_directory" placeholder="/config/jellyfin"#id="password_resets-watch_directory" value="/jf" disabled#g' /opt/build/build/data/html/setup.html
|
&& sed -i 's#id="password_resets-watch_directory" placeholder="/config/jellyfin"#id="password_resets-watch_directory" value="/jf" disabled#g' /opt/build/build/data/html/setup.html
|
||||||
|
|
||||||
FROM golang:latest
|
FROM golang:1.16rc1-buster
|
||||||
|
|
||||||
COPY --from=build /opt/build/build /opt/jfa-go
|
COPY --from=build /opt/build/build /opt/jfa-go
|
||||||
|
|
||||||
|
7
Makefile
7
Makefile
@ -4,6 +4,7 @@ ifeq ($(GOESBUILD), on)
|
|||||||
else
|
else
|
||||||
ESBUILD := npx esbuild
|
ESBUILD := npx esbuild
|
||||||
endif
|
endif
|
||||||
|
GOBINARY ?= go
|
||||||
|
|
||||||
npm:
|
npm:
|
||||||
$(info installing npm dependencies)
|
$(info installing npm dependencies)
|
||||||
@ -43,7 +44,7 @@ ts-debug:
|
|||||||
cp -r ts data/web/js
|
cp -r ts data/web/js
|
||||||
|
|
||||||
swagger:
|
swagger:
|
||||||
go1.16rc1 get github.com/swaggo/swag/cmd/swag
|
$(GOBINARY) get github.com/swaggo/swag/cmd/swag
|
||||||
swag init -g main.go
|
swag init -g main.go
|
||||||
|
|
||||||
version:
|
version:
|
||||||
@ -51,10 +52,10 @@ version:
|
|||||||
|
|
||||||
compile:
|
compile:
|
||||||
$(info Downloading deps)
|
$(info Downloading deps)
|
||||||
go1.16rc1 mod download
|
$(GOBINARY) mod download
|
||||||
$(info Building)
|
$(info Building)
|
||||||
mkdir -p build
|
mkdir -p build
|
||||||
cd build && CGO_ENABLED=0 go1.16rc1 build -o ./jfa-go ../*.go
|
cd build && CGO_ENABLED=0 $(GOBINARY) build -o ./jfa-go ../*.go
|
||||||
|
|
||||||
compress:
|
compress:
|
||||||
upx --lzma build/jfa-go
|
upx --lzma build/jfa-go
|
||||||
|
Loading…
Reference in New Issue
Block a user