Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Dockerfile to build Ubuntu builds in containers. #690

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Dockerfile
build
34 changes: 34 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
FROM ubuntu:focal AS rbdoom3bfg-buildenv
ENV DEBIAN_FRONTEND=noninteractive

# Add the Vulkan SDK repository
RUN apt-get update \
&& apt-get install -y curl gpg\
&& curl -Lso /tmp/lunarg-signing-key-pub.asc \
http://packages.lunarg.com/lunarg-signing-key-pub.asc \
&& apt-key add /tmp/lunarg-signing-key-pub.asc \
&& curl -Lso /etc/apt/sources.list.d/lunarg-vulkan-focal.list \
http://packages.lunarg.com/vulkan/lunarg-vulkan-focal.list

# Install the general RBDoom3BFG dependencies
RUN apt-get update \
&& apt-get install -y \
build-essential git cmake \
libsdl2-dev libopenal-dev vulkan-sdk \
libavcodec-dev libavformat-dev libavutil-dev libswscale-dev

# From the previous build environment stage, actually run the build
FROM rbdoom3bfg-buildenv AS build

ARG CONFIGSCRIPT=cmake-eclipse-linux-profile.sh
ENV CONFIGSCRIPT=${CONFIGSCRIPT}

ADD . /workspace
WORKDIR /workspace
RUN cd neo && ./${CONFIGSCRIPT}
RUN cd build && make

# Copy only the finished RBDoom3BFG executable to an empty image
# for use with docker build --output
FROM scratch AS export
COPY --from=build /workspace/build/RBDoom3BFG /workspace/base/maps/ /
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,19 @@ Recommended in this case is `cmake-vs2017-64bit-windows10.bat`
---
# Compiling on Linux <a name="compile_linux"></a>

## Containerised build

If your system has Docker installed, you can create RBDOOM3BFG builds without having to install any of the dependencies on your host system. There is a `Dockerfile` in this repository that will set up the environment inside an `ubuntu` container and run the build for you. To run a build inside a Docker container, simply run the following command in the root path of this repository:

> docker build . --output type=local,dest=./build

This will run a build and save the resulting executables to `./build` on your host machine. By default, this will create a build using the `eclipse-linux-profile` configuration; to customize this you can also pass in the `CONFIGSCRIPT` build argument. For example, to create a build using the Vulkan release configuration:

> docker build . --output type=local,dest=./build --build-arg CONFIGSCRIPT=cmake-linux-vulkan-release.sh


## Local build

1. You need the following dependencies in order to compile RBDoom3BFG with all features:

On Debian or Ubuntu:
Expand Down