diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000000..6a6e01c108 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +Dockerfile +build diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000..8aae129107 --- /dev/null +++ b/Dockerfile @@ -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/ / diff --git a/README.md b/README.md index 766b1fa9dc..5c8b3e4f9f 100644 --- a/README.md +++ b/README.md @@ -459,6 +459,19 @@ Recommended in this case is `cmake-vs2017-64bit-windows10.bat` --- # Compiling on Linux +## 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: