Browse Source

Updated make to build 100% static binaries, added Dockerfile

1.0
Gisle Aune 7 years ago
parent
commit
923c246b61
  1. 6
      Dockerfile
  2. 13
      makefile

6
Dockerfile

@ -0,0 +1,6 @@
FROM alpine
COPY build/usr /usr
COPY build/etc /etc
CMD ["/bin/sh"]

13
makefile

@ -1,5 +1,4 @@
INSTALL_PATH ?= ./build
CGO_ENABLED ?= 0
# Build all the things
build: build-server build-tools
@ -19,15 +18,15 @@ build-server: setup
mkdir -p $(INSTALL_PATH)/usr/bin
mkdir -p $(INSTALL_PATH)/etc/aiterp
cp ./config.example.json $(INSTALL_PATH)/etc/aiterp/rpdata.json
go build -ldflags="-s -w" -o $(INSTALL_PATH)/usr/bin/rpdata-graphiql ./cmd/rpdata-graphiql
CGO_ENABLED=0 go build -a -installsuffix cgo -ldflags="-s -w" -o $(INSTALL_PATH)/usr/bin/rpdata-graphiql ./cmd/rpdata-graphiql
# Build the tools needed to port data over
build-tools: build-server
go build -ldflags="-s -w" -o $(INSTALL_PATH)/usr/bin/rpdata-lb2charimport ./cmd/rpdata-lb2charimport
go build -ldflags="-s -w" -o $(INSTALL_PATH)/usr/bin/rpdata-lb2logimport ./cmd/rpdata-lb2logimport
go build -ldflags="-s -w" -o $(INSTALL_PATH)/usr/bin/rpdata-wikifileimport ./cmd/rpdata-wikifileimport
go build -ldflags="-s -w" -o $(INSTALL_PATH)/usr/bin/rpdata-ensurechannels ./cmd/rpdata-ensurechannels
go build -ldflags="-s -w" -o $(INSTALL_PATH)/usr/bin/rpdata-as2storyimport ./cmd/rpdata-ensurechannels
CGO_ENABLED=0 go build -a -installsuffix cgo -ldflags="-s -w" -o $(INSTALL_PATH)/usr/bin/rpdata-lb2charimport ./cmd/rpdata-lb2charimport
CGO_ENABLED=0 go build -a -installsuffix cgo -ldflags="-s -w" -o $(INSTALL_PATH)/usr/bin/rpdata-lb2logimport ./cmd/rpdata-lb2logimport
CGO_ENABLED=0 go build -a -installsuffix cgo -ldflags="-s -w" -o $(INSTALL_PATH)/usr/bin/rpdata-wikifileimport ./cmd/rpdata-wikifileimport
CGO_ENABLED=0 go build -a -installsuffix cgo -ldflags="-s -w" -o $(INSTALL_PATH)/usr/bin/rpdata-ensurechannels ./cmd/rpdata-ensurechannels
CGO_ENABLED=0 go build -a -installsuffix cgo -ldflags="-s -w" -o $(INSTALL_PATH)/usr/bin/rpdata-as2storyimport ./cmd/rpdata-ensurechannels
# Install locally (requires access to /usr/bin, hence no dependency on build)
install:
Loading…
Cancel
Save