From d0cec6150d2e7f92d6cacd5d516b2610327a78d5 Mon Sep 17 00:00:00 2001 From: Thomas Rudin Date: Thu, 31 Jan 2019 13:22:06 +0100 Subject: [PATCH] docker image --- server/Makefile | 5 ++++- server/docker/Dockerfile | 9 +++++++++ server/docker/Makefile | 4 ++++ 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 server/docker/Dockerfile create mode 100644 server/docker/Makefile diff --git a/server/Makefile b/server/Makefile index ebab1eb..b0adaf3 100644 --- a/server/Makefile +++ b/server/Makefile @@ -21,11 +21,14 @@ $(STATIC_VFS): test -f esc || $(ENV) go get github.com/mjibson/esc ${HOME}/go/bin/esc -o $@ -prefix="static/" -pkg vfs static +build-docker: + docker run --rm -it -v /home/thomas/git/mapserver/server/:/app -v mapserver-volume:/root/go -w /app mapserver-builder make + build: $(STATIC_VFS) $(OUT_DIR) # native CGO_ENABLED=1 GOOS=linux GOARCH=amd64 CC=x86_64-linux-gnu-gcc go build $(GO_LDFLAGS) -o $(OUT_DIR)/mapserver-linux-x86_64 # apt install gcc-8-i686-linux-gnu - CGO_ENABLED=1 GOOS=linux GOARCH=386 CC=i686-linux-gnu-gcc-8 go build $(GO_LDFLAGS) -o $(OUT_DIR)/mapserver-linux-x86 + CGO_ENABLED=1 GOOS=linux GOARCH=386 CC=i686-linux-gnu-gcc-7 go build $(GO_LDFLAGS) -o $(OUT_DIR)/mapserver-linux-x86 # apt install gcc-mingw-w64 GOARCH=386 GOOS=windows CC=i686-w64-mingw32-gcc CGO_ENABLED=1 go build -o $(OUT_DIR)/mapserver-windows-x86.exe GOARCH=amd64 GOOS=windows CC=x86_64-w64-mingw32-gcc CGO_ENABLED=1 go build -o $(OUT_DIR)/mapserver-windows-x86-64.exe diff --git a/server/docker/Dockerfile b/server/docker/Dockerfile new file mode 100644 index 0000000..a9a7712 --- /dev/null +++ b/server/docker/Dockerfile @@ -0,0 +1,9 @@ +from ubuntu + +run apt-get update &&\ + apt-get install -y gcc-mingw-w64 gcc-5-arm-linux-gnueabihf gcc-i686-linux-gnu &&\ + apt-get install -y software-properties-common git &&\ + add-apt-repository ppa:longsleep/golang-backports &&\ + apt-get update &&\ + apt-get install -y golang-go + diff --git a/server/docker/Makefile b/server/docker/Makefile new file mode 100644 index 0000000..d300ef6 --- /dev/null +++ b/server/docker/Makefile @@ -0,0 +1,4 @@ +TAG=mapserver-builder + +build: + docker build . -t $(TAG)