mirror of
https://github.com/godotengine/build-containers.git
synced 2025-12-31 21:48:41 +03:00
Linux: New container based on Fedora using Godot SDKs
We now provide pre-built toolchains for Linux with old glibc and the required Godot dependencies, which can be used to build portable Godot binaries without having to be on an extremely old Linux distro. So we can retire the old Ubuntu 14.04 containers and instead do our portable builds directly on Fedora 34, like for other platforms. This commit also makes use of `godot-mono-builds` to build Mono and the BCL for Linux, instead of doing it manually. The same will be done for Windows and macOS in the next commit.
This commit is contained in:
41
Dockerfile.linux
Normal file
41
Dockerfile.linux
Normal file
@@ -0,0 +1,41 @@
|
||||
ARG img_version
|
||||
FROM godot-mono:${img_version}
|
||||
|
||||
ARG mono_version
|
||||
|
||||
ENV GODOT_SDK_LINUX_X86_64=/root/x86_64-godot-linux-gnu_sdk-buildroot
|
||||
ENV GODOT_SDK_LINUX_X86=/root/i686-godot-linux-gnu_sdk-buildroot
|
||||
ENV BASE_PATH=${PATH}
|
||||
|
||||
RUN if [ -z "${mono_version}" ]; then echo -e "\n\nargument mono-version is mandatory!\n\n"; exit 1; fi && \
|
||||
dnf -y install --setopt=install_weak_deps=False \
|
||||
libxcrypt-compat yasm && \
|
||||
curl -LO https://downloads.tuxfamily.org/godotengine/toolchains/linux/2021-02-11/x86_64-godot-linux-gnu_sdk-buildroot.tar.bz2 && \
|
||||
tar xf x86_64-godot-linux-gnu_sdk-buildroot.tar.bz2 && \
|
||||
rm -f x86_64-godot-linux-gnu_sdk-buildroot.tar.bz2 && \
|
||||
cd x86_64-godot-linux-gnu_sdk-buildroot && \
|
||||
./relocate-sdk.sh && \
|
||||
rm -f bin/{aclocal*,auto*,libtool*,m4} && \
|
||||
cd /root && \
|
||||
curl -LO https://downloads.tuxfamily.org/godotengine/toolchains/linux/2021-02-11/i686-godot-linux-gnu_sdk-buildroot.tar.bz2 && \
|
||||
tar xf i686-godot-linux-gnu_sdk-buildroot.tar.bz2 && \
|
||||
rm -f i686-godot-linux-gnu_sdk-buildroot.tar.bz2 && \
|
||||
cd i686-godot-linux-gnu_sdk-buildroot && \
|
||||
./relocate-sdk.sh && \
|
||||
rm -f bin/{aclocal*,auto*,libtool*,m4} && \
|
||||
cp -a /root/files/${mono_version} /root && \
|
||||
export MONO_SOURCE_ROOT=/root/${mono_version} && \
|
||||
cd /root/${mono_version}/godot-mono-builds && \
|
||||
export PATH=${GODOT_SDK_LINUX_X86_64}/bin:${BASE_PATH} && \
|
||||
python3 linux.py configure -j --target=x86_64 && \
|
||||
python3 linux.py make -j --target=x86_64 && \
|
||||
export PATH=${GODOT_SDK_LINUX_X86}/bin:${BASE_PATH} && \
|
||||
python3 linux.py configure -j --target=x86 && \
|
||||
python3 linux.py make -j --target=x86 && \
|
||||
export PATH=${GODOT_SDK_LINUX_X86_64}/bin:${BASE_PATH} && \
|
||||
python3 bcl.py make -j --product=desktop && \
|
||||
python3 linux.py copy-bcl --target=x86_64 --target=x86 && \
|
||||
cd /root && \
|
||||
rm -rf /root/${mono_version}
|
||||
|
||||
CMD /bin/bash
|
||||
@@ -1,32 +0,0 @@
|
||||
FROM i386/ubuntu:xenial
|
||||
|
||||
ARG mono_version
|
||||
|
||||
RUN if [ -z "${mono_version}" ]; then echo -e "\n\nargument mono-version is mandatory!\n\n"; exit 1; fi && \
|
||||
apt-get -y update && \
|
||||
apt-get -y install --no-install-recommends \
|
||||
autoconf automake bzip2 ca-certificates cmake curl gettext git libtool make perl python3 scons wget xz-utils \
|
||||
gcc g++ libudev-dev libx11-dev libxcursor-dev libxrandr-dev libasound2-dev libpulse-dev \
|
||||
libgl1-mesa-dev libglu1-mesa-dev libxi-dev libxinerama-dev yasm
|
||||
|
||||
RUN cp -a /root/files/${mono_version} /root && \
|
||||
cd /root/${mono_version} && \
|
||||
NOCONFIGURE=1 ./autogen.sh && \
|
||||
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var/lib/mono --disable-boehm --host=i386-linux-gnu && \
|
||||
make -j && \
|
||||
make install && \
|
||||
cd /root && \
|
||||
rm -rf /root/${mono_version} && \
|
||||
cert-sync /etc/ssl/certs/ca-certificates.crt && \
|
||||
wget https://download.mono-project.com/repo/ubuntu/pool/main/m/msbuild/msbuild_16.6+xamarinxplat.2021.01.15.16.11-0xamarin1+ubuntu1604b1_all.deb && \
|
||||
wget https://download.mono-project.com/repo/ubuntu/pool/main/m/msbuild/msbuild-sdkresolver_16.6+xamarinxplat.2021.01.15.16.11-0xamarin1+ubuntu1604b1_all.deb && \
|
||||
wget https://download.mono-project.com/repo/ubuntu/pool/main/c/core-setup/msbuild-libhostfxr_3.0.0.2019.04.16.02.13-0xamarin4+ubuntu1604b1_i386.deb && \
|
||||
wget https://download.mono-project.com/repo/ubuntu/pool/main/n/nuget/nuget_5.6.0.6489.bin-0xamarin1+ubuntu1604b1_all.deb && \
|
||||
dpkg -i --force-all *.deb && \
|
||||
sed -i '/Depends.*mono/d' /var/lib/dpkg/status && \
|
||||
ln -s /usr/bin/mono /usr/bin/cli && \
|
||||
apt-get clean && \
|
||||
rm -rf /var/lib/apt/lists/ && \
|
||||
rm *.deb
|
||||
|
||||
CMD /bin/bash
|
||||
@@ -1,43 +0,0 @@
|
||||
FROM ubuntu:trusty
|
||||
|
||||
ARG mono_version
|
||||
|
||||
RUN if [ -z "${mono_version}" ]; then echo -e "\n\nargument mono-version is mandatory!\n\n"; exit 1; fi && \
|
||||
apt-get update && \
|
||||
apt-get -y install wget && \
|
||||
cd /root && \
|
||||
wget -O- 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x1E9377A2BA9EF27F' | apt-key add - && \
|
||||
wget -O- 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x8E51A6D660CD88D67D65221D90BD7EACED8E640A' | apt-key add - && \
|
||||
echo 'deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu trusty main' >> /etc/apt/sources.list && \
|
||||
echo 'deb http://ppa.launchpad.net/mc3man/trusty-media/ubuntu trusty main' >> /etc/apt/sources.list && \
|
||||
apt-get -y update && \
|
||||
apt-get -y install --no-install-recommends \
|
||||
autoconf automake bzip2 cmake curl gettext git libtool make perl scons xz-utils \
|
||||
gcc-9 g++-9 libudev-dev libx11-dev libxcursor-dev libxrandr-dev libasound2-dev libpulse-dev \
|
||||
libgl1-mesa-dev libglu1-mesa-dev libxi-dev libxinerama-dev yasm && \
|
||||
ln -sf /usr/bin/gcc-ranlib-9 /usr/bin/gcc-ranlib && \
|
||||
ln -sf /usr/bin/gcc-ar-9 /usr/bin/gcc-ar && \
|
||||
ln -sf /usr/bin/gcc-9 /usr/bin/gcc && \
|
||||
ln -sf /usr/bin/g++-9 /usr/bin/g++
|
||||
|
||||
RUN cp -a /root/files/${mono_version} /root && \
|
||||
cd /root/${mono_version} && \
|
||||
NOCONFIGURE=1 ./autogen.sh && \
|
||||
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var/lib/mono --disable-boehm --host=x86_64-linux-gnu && \
|
||||
make -j && \
|
||||
make install && \
|
||||
cd /root && \
|
||||
rm -rf /root/${mono_version} && \
|
||||
cert-sync /etc/ssl/certs/ca-certificates.crt && \
|
||||
wget https://download.mono-project.com/repo/ubuntu/pool/main/m/msbuild/msbuild_16.6+xamarinxplat.2021.01.15.16.11-0xamarin1+ubuntu1604b1_all.deb && \
|
||||
wget https://download.mono-project.com/repo/ubuntu/pool/main/m/msbuild/msbuild-sdkresolver_16.6+xamarinxplat.2021.01.15.16.11-0xamarin1+ubuntu1604b1_all.deb && \
|
||||
wget https://download.mono-project.com/repo/ubuntu/pool/main/c/core-setup/msbuild-libhostfxr_3.0.0.2019.04.16.02.13-0xamarin4+ubuntu1604b1_amd64.deb && \
|
||||
wget https://download.mono-project.com/repo/ubuntu/pool/main/n/nuget/nuget_5.6.0.6489.bin-0xamarin1+ubuntu1604b1_all.deb && \
|
||||
dpkg -i --force-all *.deb && \
|
||||
sed -i '/Depends.*mono/d' /var/lib/dpkg/status && \
|
||||
ln -s /usr/bin/mono /usr/bin/cli && \
|
||||
apt-get clean && \
|
||||
rm -rf /var/lib/apt/lists/ && \
|
||||
rm *.deb
|
||||
|
||||
CMD /bin/bash
|
||||
@@ -54,9 +54,8 @@ your custom modifications.
|
||||
If you don't need to build all versions or you want to try with a single target OS first,
|
||||
you can comment out the corresponding lines from the script:
|
||||
|
||||
$podman_build_mono -t godot-linux:${img_version} -f Dockerfile.linux . 2>&1 | tee logs/linux.log
|
||||
$podman_build_mono -t godot-windows:${img_version} -f Dockerfile.windows --ulimit nofile=65536 . 2>&1 | tee logs/windows.log
|
||||
$podman_build_mono -t godot-ubuntu-64:${img_version} -f Dockerfile.ubuntu-64 . 2>&1 | tee logs/ubuntu-64.log
|
||||
$podman_build_mono -t godot-ubuntu-32:${img_version} -f Dockerfile.ubuntu-32 . 2>&1 | tee logs/ubuntu-32.log
|
||||
$podman_build_mono -t godot-javascript:${img_version} -f Dockerfile.javascript . 2>&1 | tee logs/javascript.log
|
||||
$podman_build_mono -t godot-android:${img_version} -f Dockerfile.android . 2>&1 | tee logs/android.log
|
||||
...
|
||||
|
||||
6
build.sh
6
build.sh
@@ -113,10 +113,8 @@ $podman_build -t godot-export:${img_version} -f Dockerfile.export . 2>&1 | tee l
|
||||
|
||||
$podman_build_mono -t godot-mono:${img_version} -f Dockerfile.mono . 2>&1 | tee logs/mono.log
|
||||
$podman_build_mono -t godot-mono-glue:${img_version} -f Dockerfile.mono-glue . 2>&1 | tee logs/mono-glue.log
|
||||
# The ulimit below is necessary to use Wine to workaround Mono cross-compilation bugs (see GH-32).
|
||||
$podman_build_mono -t godot-windows:${img_version} -f Dockerfile.windows --ulimit nofile=65536 . 2>&1 | tee logs/windows.log
|
||||
$podman_build_mono -t godot-ubuntu-64:${img_version} -f Dockerfile.ubuntu-64 . 2>&1 | tee logs/ubuntu-64.log
|
||||
$podman_build_mono -t godot-ubuntu-32:${img_version} -f Dockerfile.ubuntu-32 . 2>&1 | tee logs/ubuntu-32.log
|
||||
$podman_build_mono -t godot-linux:${img_version} -f Dockerfile.linux . 2>&1 | tee logs/linux.log
|
||||
$podman_build_mono -t godot-windows:${img_version} -f Dockerfile.windows . 2>&1 | tee logs/windows.log
|
||||
$podman_build_mono -t godot-javascript:${img_version} -f Dockerfile.javascript . 2>&1 | tee logs/javascript.log
|
||||
$podman_build_mono -t godot-android:${img_version} -f Dockerfile.android . 2>&1 | tee logs/android.log
|
||||
|
||||
|
||||
@@ -21,9 +21,8 @@ fi
|
||||
|
||||
$podman push godot-export:${img_version} ${registry}/godot/export
|
||||
$podman push godot-mono-glue:${img_version} ${registry}/godot/mono-glue
|
||||
$podman push godot-linux:${img_version} ${registry}/godot/linux
|
||||
$podman push godot-windows:${img_version} ${registry}/godot/windows
|
||||
$podman push godot-ubuntu-32:${img_version} ${registry}/godot/ubuntu-32
|
||||
$podman push godot-ubuntu-64:${img_version} ${registry}/godot/ubuntu-64
|
||||
$podman push godot-javascript:${img_version} ${registry}/godot/javascript
|
||||
$podman push godot-xcode-packer:${img_version} ${registry}/godot/xcode-packer
|
||||
|
||||
|
||||
Reference in New Issue
Block a user