From 04cf14de8e904ff88bfa8df4189a79b487e4e367 Mon Sep 17 00:00:00 2001 From: Mitch Roote Date: Mon, 25 Jan 2021 12:50:08 -0500 Subject: [PATCH 1/3] Fix Dockerfile-build for Windows cross compilation --- docker/Dockerfile-build | 7 ++++--- docker/README.md | 2 ++ docker/build-release.sh | 5 +++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/docker/Dockerfile-build b/docker/Dockerfile-build index 72677b3..be131be 100644 --- a/docker/Dockerfile-build +++ b/docker/Dockerfile-build @@ -1,14 +1,14 @@ FROM alpine:latest as build -RUN apk add --no-cache git make musl-dev go nodejs npm zip +RUN apk add --no-cache git make musl-dev go nodejs npm zip mingw-w64-gcc -ENV FACTORIO_BRANCH=develop ENV GOROOT /usr/lib/go ENV GOPATH /go ENV PATH /go/bin:$PATH ENV FACTORIO_ROOT /go/src/factorio-server-manager -COPY build-release.sh /usr/local/bin/build-release.sh +COPY docker/build-release.sh /usr/local/bin/build-release.sh +COPY ./ $FACTORIO_ROOT RUN mkdir -p ${GOPATH}/bin RUN chmod u+x /usr/local/bin/build-release.sh @@ -16,6 +16,7 @@ RUN chmod u+x /usr/local/bin/build-release.sh WORKDIR $FACTORIO_ROOT VOLUME /build +VOLUME $FACTORIO_ROOT RUN ["/usr/local/bin/build-release.sh"] diff --git a/docker/README.md b/docker/README.md index 2c7f4f0..371cbfe 100644 --- a/docker/README.md +++ b/docker/README.md @@ -85,6 +85,8 @@ For development purposes it also has the ability to create the docker image from A Dockerfile-build file is included for creating the release bundles. To create the bundle build the Dockerfile-build file with the following command. The release bundles are output to the ./dist directory. + +Run this command from the root factorio-server-manager directory. ``` DOCKER_BUILDKIT=1 docker build --no-cache -f Dockerfile-build -t ofsm-build --target=output -o dist . ``` diff --git a/docker/build-release.sh b/docker/build-release.sh index 0ad0731..9370276 100755 --- a/docker/build-release.sh +++ b/docker/build-release.sh @@ -1,7 +1,8 @@ #!/bin/sh -echo "Cloning ${FACTORIO_BRANCH}" -git clone -b ${FACTORIO_BRANCH} https://github.com/mroote/factorio-server-manager.git ${FACTORIO_ROOT} +go_version=$(go version) + +echo "Go Version: ${go_version}" echo "Creating build..." make gen_release echo "Copying build artifacts from ${PWD}" From dc8b19efc56afb6832b9f2a453340f71af197c71 Mon Sep 17 00:00:00 2001 From: Mitch Roote Date: Mon, 25 Jan 2021 13:03:07 -0500 Subject: [PATCH 2/3] update README build command --- docker/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/README.md b/docker/README.md index 371cbfe..4ad65c6 100644 --- a/docker/README.md +++ b/docker/README.md @@ -88,7 +88,7 @@ To create the bundle build the Dockerfile-build file with the following command. Run this command from the root factorio-server-manager directory. ``` -DOCKER_BUILDKIT=1 docker build --no-cache -f Dockerfile-build -t ofsm-build --target=output -o dist . +DOCKER_BUILDKIT=1 docker build --no-cache -f docker/Dockerfile-build -t ofsm-build --target=output -o dist . ``` ## For everyone who actually read this thing to the end From 0e44a752c25c1f856a931c0564325861f2e80c89 Mon Sep 17 00:00:00 2001 From: Mitch Roote Date: Mon, 25 Jan 2021 22:18:50 -0500 Subject: [PATCH 3/3] output to build directory, use docker v20 --- docker/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/README.md b/docker/README.md index 4ad65c6..da52407 100644 --- a/docker/README.md +++ b/docker/README.md @@ -82,13 +82,13 @@ Authentication is supported in the application, but it is recommended to ensure For development purposes it also has the ability to create the docker image from local sourcecode. This is done by running `build.sh` in the `docker` directory. This will delete all old executables and the node_modules directory (runs `make build`). The created docker image will have the tag `factorio-server-manager:dev`. ### Creating release bundles -A Dockerfile-build file is included for creating the release bundles. +A Dockerfile-build file is included for creating the release bundles. Use Docker version 20 in order to use the BUILDKIT environment, some issues have been encountered with Docker version 19. To create the bundle build the Dockerfile-build file with the following command. The release bundles are output to the ./dist directory. Run this command from the root factorio-server-manager directory. ``` -DOCKER_BUILDKIT=1 docker build --no-cache -f docker/Dockerfile-build -t ofsm-build --target=output -o dist . +DOCKER_BUILDKIT=1 docker build --no-cache -f docker/Dockerfile-build -t ofsm-build --target=build -o dist . ``` ## For everyone who actually read this thing to the end