2024-02-24 15:52:18 +00:00
|
|
|
# Docker image to build DDNet for Linux and Windows (32 bit, 64 bit)
|
|
|
|
# Usage:
|
|
|
|
# 1. Build image
|
|
|
|
# docker build -t ddnet - < Dockerfile
|
|
|
|
# 2. Run the DDNet build script
|
|
|
|
# docker run -it -v PATH_TO_DDNET:/ddnet:ro -v PATH_TO_OUTPUT_DIRECTORY:/build ddnet ./build-all.sh
|
|
|
|
FROM debian:12
|
2018-03-02 03:46:39 +00:00
|
|
|
|
2024-02-24 15:52:18 +00:00
|
|
|
RUN apt-get update && apt-get install -y gcc-mingw-w64-x86-64-posix \
|
|
|
|
g++-mingw-w64-x86-64-posix \
|
|
|
|
gcc-mingw-w64-i686-posix \
|
|
|
|
g++-mingw-w64-i686-posix \
|
2018-03-02 03:46:39 +00:00
|
|
|
wget \
|
|
|
|
git \
|
|
|
|
ca-certificates \
|
|
|
|
build-essential \
|
|
|
|
python3 \
|
|
|
|
libcurl4-openssl-dev \
|
|
|
|
libfreetype6-dev \
|
|
|
|
libglew-dev \
|
|
|
|
libogg-dev \
|
|
|
|
libopus-dev \
|
2022-06-11 07:09:42 +00:00
|
|
|
libpng-dev \
|
2018-03-02 03:46:39 +00:00
|
|
|
libwavpack-dev \
|
|
|
|
libopusfile-dev \
|
2021-09-09 07:24:37 +00:00
|
|
|
libsdl2-dev \
|
2024-02-24 15:52:18 +00:00
|
|
|
cmake \
|
|
|
|
glslang-tools \
|
|
|
|
libavcodec-extra \
|
|
|
|
libavdevice-dev \
|
|
|
|
libavfilter-dev \
|
|
|
|
libavformat-dev \
|
|
|
|
libavutil-dev \
|
|
|
|
libcurl4-openssl-dev \
|
|
|
|
libnotify-dev \
|
|
|
|
libsqlite3-dev \
|
|
|
|
libssl-dev \
|
|
|
|
libvulkan-dev \
|
|
|
|
libx264-dev \
|
|
|
|
spirv-tools \
|
|
|
|
curl
|
2018-04-03 15:40:00 +00:00
|
|
|
|
2024-02-24 15:52:18 +00:00
|
|
|
RUN curl https://sh.rustup.rs -sSf | \
|
|
|
|
sh -s -- --default-toolchain stable -y
|
2018-04-03 15:40:00 +00:00
|
|
|
|
2024-02-24 15:52:18 +00:00
|
|
|
RUN ~/.cargo/bin/rustup toolchain install stable
|
|
|
|
RUN ~/.cargo/bin/rustup target add i686-pc-windows-gnu
|
|
|
|
RUN ~/.cargo/bin/rustup target add x86_64-pc-windows-gnu
|
2018-03-02 03:46:39 +00:00
|
|
|
|
|
|
|
RUN printf '#!/bin/bash\n \
|
2024-02-24 15:52:18 +00:00
|
|
|
export PATH=$PATH:$HOME/.cargo/bin\n \
|
2018-03-02 03:46:39 +00:00
|
|
|
set -x\n \
|
2024-02-24 15:52:18 +00:00
|
|
|
mkdir /build\n \
|
2018-04-03 10:16:31 +00:00
|
|
|
mkdir /build/linux\n \
|
|
|
|
cd /build/linux\n \
|
2018-03-02 03:46:39 +00:00
|
|
|
pwd\n \
|
2024-02-24 15:52:18 +00:00
|
|
|
cmake /ddnet && make -j$(nproc) \n \
|
2018-04-03 10:16:31 +00:00
|
|
|
mkdir /build/win64\n \
|
|
|
|
cd /build/win64\n \
|
2018-03-02 03:46:39 +00:00
|
|
|
pwd\n \
|
2024-02-24 15:52:18 +00:00
|
|
|
cmake -DCMAKE_TOOLCHAIN_FILE=/ddnet/cmake/toolchains/mingw64.toolchain /ddnet && make -j$(nproc) \n \
|
2018-04-03 10:16:31 +00:00
|
|
|
mkdir /build/win32\n \
|
|
|
|
cd /build/win32\n \
|
2018-03-02 03:46:39 +00:00
|
|
|
pwd\n \
|
2024-02-24 15:52:18 +00:00
|
|
|
cmake -DCMAKE_TOOLCHAIN_FILE=/ddnet/cmake/toolchains/mingw32.toolchain /ddnet && make -j$(nproc) \n' \
|
|
|
|
> build-all.sh
|
2018-03-02 03:46:39 +00:00
|
|
|
RUN chmod +x build-all.sh
|
2018-04-03 15:40:00 +00:00
|
|
|
RUN mkdir /build
|