diff --git a/Dockerfile b/Dockerfile index ff065d8c8a..8aae129107 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,34 @@ -FROM ubuntu:focal AS build +FROM ubuntu:focal AS rbdoom3bfg-buildenv +ENV DEBIAN_FRONTEND=noninteractive -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 -ADD . /workspace +# Install the general RBDoom3BFG dependencies RUN apt-get update \ && apt-get install -y \ build-essential git cmake \ - libsdl2-dev libopenal-dev libavcodec-dev libavformat-dev libavutil-dev libswscale-dev + 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 && ./cmake-eclipse-linux-profile.sh +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 650499e8ef..5c8b3e4f9f 100644 --- a/README.md +++ b/README.md @@ -465,7 +465,10 @@ If your system has Docker installed, you can create RBDOOM3BFG builds without ha > docker build . --output type=local,dest=./build -This will run a build and save the resulting executables to `./build` on your host machine. +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