OpenFactorioServerManager / factorio-server-manager

A tool to help manage Factorio multiplayer servers including mods and save games.
MIT License
544 stars 132 forks source link

Fix Dockerfile-build for Windows cross compilation #238

Closed mroote closed 3 years ago

mroote commented 3 years ago

Add packages for Windows compilation, add note to run from root directory to make build files.

knoxfighter commented 3 years ago

Running the command written in the Readme, results in an apk error:

knox@knox-Lenovo-Y50-70:~/Desktop/Programme/temp2/factorio-server-manager-fix-dockerfile-build$ DOCKER_BUILDKIT=1 docker build --no-cache -f docker/Dockerfile-build -t ofsm-build --target=output -o dist .
[+] Building 1.5s (6/13)                                                                                                                                                                                           
 => [internal] load .dockerignore                                                                                                                                                                             0.0s
 => => transferring context: 2B                                                                                                                                                                               0.0s
 => [internal] load build definition from Dockerfile-build                                                                                                                                                    0.0s
 => => transferring dockerfile: 44B                                                                                                                                                                           0.0s
 => [internal] load metadata for docker.io/library/alpine:latest                                                                                                                                              1.1s
 => [internal] load build context                                                                                                                                                                             0.0s
 => => transferring context: 7.01kB                                                                                                                                                                           0.0s
 => CACHED [build 1/8] FROM docker.io/library/alpine:latest@sha256:d9a7354e3845ea8466bb00b22224d9116b183e594527fb5b6c3d30bc01a20378                                                                           0.0s
 => ERROR [build 2/8] RUN apk add --no-cache git make musl-dev go nodejs npm zip mingw-w64-gcc                                                                                                                0.4s
------                                                                                                                                                                                                             
 > [build 2/8] RUN apk add --no-cache git make musl-dev go nodejs npm zip mingw-w64-gcc:
#5 0.299 ERROR: Unable to lock database: Permission denied
#5 0.299 ERROR: Failed to open apk database: Permission denied
------
failed to solve with frontend dockerfile.v0: failed to build LLB: executor failed running [/bin/sh -c apk add --no-cache git make musl-dev go nodejs npm zip mingw-w64-gcc]: runc did not terminate sucessfully
mroote commented 3 years ago

hmm I'm not sure why you would get permissions errors there trying to install the packages.

It looks like we are on the same latest alpine container, I have this one on my system:

❯ docker inspect --format='{{index .RepoDigests 0}}' alpine:latest
alpine@sha256:d9a7354e3845ea8466bb00b22224d9116b183e594527fb5b6c3d30bc01a20378

If you just run the base alpine container can you run the apk commands there? Also what version of docker are you running?