Skip to content

Commit

Permalink
Add all supported targets to Docker
Browse files Browse the repository at this point in the history
  • Loading branch information
slipher committed Mar 24, 2021
1 parent f49e051 commit 951b688
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 7 deletions.
11 changes: 7 additions & 4 deletions Dockerfile
Expand Up @@ -13,8 +13,8 @@ ENV TOOLCHAIN_DEPS=' \
make \
p7zip-full \
python2 \
python-jinja2 \
python-yaml \
python3-jinja2 \
python3-yaml \
rsync \
'

Expand Down Expand Up @@ -59,7 +59,6 @@ RUN update-alternatives --set i686-w64-mingw32-gcc /usr/bin/i686-w64-mingw32-gcc
update-alternatives --set i686-w64-mingw32-g++ /usr/bin/i686-w64-mingw32-g++-posix && \
update-alternatives --set x86_64-w64-mingw32-gcc /usr/bin/x86_64-w64-mingw32-gcc-posix && \
update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix
# TODO: try mingw targets and vms

ARG rev
RUN test -n "$rev"
Expand All @@ -80,4 +79,8 @@ RUN ./build.sh linux64 install

COPY build-release /
WORKDIR /Unvanquished
RUN /build-release -j`nproc` linux-amd64
ARG targets='linux-amd64 windows-i686 windows-amd64 vm'
RUN /build-release -j`nproc` ${targets}

COPY build-release make-unizip unizip-readme.txt /
RUN /make-unizip /Unvanquished/build/release
23 changes: 20 additions & 3 deletions README.md
@@ -1,15 +1,32 @@
## Building static Linux binaries with Docker
`build-release` is the entry point to generate the binaries and Breakpad symbol files for a given
platform. Currently the working configurations are Linux hosts for Linux, NaCl, or Windows
targets and binaries and MSYS2 for Windows targets. For Linux, it is difficult to set up the
required static libraries, so the Docker build is especially useful.

## Building in docker

For the `rev` argument, you should use a tag or a commit hash, rather than a branch
name, in order to avoid false caching.

It is recommended to check the results with [validate-release](https://github.com/Unvanquished/validate-release),
e.g. `../validate-release/validate-release linux-amd64.zip`.

### Build static Linux binaries
```
# Build
docker build -t unvrel . --build-arg=rev=3173f3307
docker build -t unvrel . --build-arg=rev=3173f3307 --build-arg=targets=linux-amd64
# Get outputs
docker create --name tmp unvrel
docker cp tmp:/Unvanquished/build/release/linux-amd64.zip .
docker rm tmp
```

It is recommended to check the results with [validate-release](https://github.com/Unvanquished/validate-release), e.g. `../validate-release/validate-release linux-amd64.zip`.
### Build everything supported in Docker
```
# Build
docker build -t unvrel . --build-arg=rev=8bef4ceee
# Get outputs
docker create --name tmp unvrel
docker cp tmp:/Unvanquished/build/release/unvanquished_0.zip .
docker rm tmp
```

0 comments on commit 951b688

Please sign in to comment.