Skip to content

Commit 6a799cb

Browse files
authored
Merge pull request #40 from tinmanjuggernaut/optimize_mono_dl
Optimize mono & dnf downloads
2 parents 854a4e4 + 86739a8 commit 6a799cb

14 files changed

+112
-113
lines changed

Dockerfile.android

+5-11
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,10 @@ ARG img_version
22
FROM godot-mono:${img_version}
33

44
ARG mono_version
5-
ARG mono_commit
65

76
RUN if [ -z "${mono_version}" ]; then echo -e "\n\nargument mono-version is mandatory!\n\n"; exit 1; fi && \
87
dnf -y install --setopt=install_weak_deps=False \
98
gcc gcc-c++ java-1.8.0-openjdk-devel ncurses-compat-libs && \
10-
dnf clean all && \
119
mkdir sdk && cd sdk && \
1210
curl -LO https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip && \
1311
unzip sdk-tools-linux-4333796.zip && \
@@ -18,23 +16,19 @@ RUN if [ -z "${mono_version}" ]; then echo -e "\n\nargument mono-version is mand
1816
ENV ANDROID_HOME=/root/sdk/
1917
ENV ANDROID_NDK_ROOT=/root/sdk/ndk-bundle/
2018

21-
RUN git clone https://github.com/mono/mono --branch ${mono_version} --single-branch && \
22-
cd /root/mono && \
23-
if [ ! -z "${mono_commit}" ]; then git checkout ${mono_commit}; fi && \
24-
git submodule update --init && \
25-
git apply -3 /root/files/patches/mono-unity-Clear-TLS-instead-of-aborting.patch && \
26-
export MONO_SOURCE_ROOT=/root/mono && \
19+
RUN cp -a /root/files/${mono_version} /root && \
20+
export MONO_SOURCE_ROOT=/root/${mono_version} && \
2721
export make="make -j" && \
28-
git clone https://github.com/godotengine/godot-mono-builds /root/godot-mono-builds && \
22+
git clone --progress https://github.com/godotengine/godot-mono-builds /root/godot-mono-builds && \
2923
cd /root/godot-mono-builds && \
3024
git checkout 710b275fbf29ddb03fd5285c51782951a110cdab && \
3125
python3 patch_mono.py && \
3226
python3 android.py configure --target=all-runtime && \
3327
python3 android.py make --target=all-runtime && \
34-
cd /root/mono && git clean -fdx && NOCONFIGURE=1 ./autogen.sh && \
28+
cd /root/${mono_version} && git clean -fdx && NOCONFIGURE=1 ./autogen.sh && \
3529
cd /root/godot-mono-builds && \
3630
python3 bcl.py make --product=android && \
3731
cd /root && \
38-
rm -rf /root/mono /root/godot-mono-builds
32+
rm -rf /root/${mono_version} /root/godot-mono-builds
3933

4034
CMD /bin/bash

Dockerfile.base

+2-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ WORKDIR /root
44

55
RUN dnf -y upgrade --setopt=install_weak_deps=False && \
66
dnf -y install --setopt=install_weak_deps=False \
7-
bash bzip2 curl git make patch pkgconfig python3 scons unzip which xz && \
8-
dnf clean all
7+
bash bzip2 curl git make patch pkgconfig python3 scons unzip which xz
98

10-
CMD /bin/true
9+
CMD /bin/bash

Dockerfile.export

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ ARG img_version
22
FROM godot-fedora:${img_version}
33

44
RUN dnf -y install --setopt=install_weak_deps=False \
5-
xorg-x11-server-Xvfb mesa-dri-drivers libXcursor libXinerama libXrandr libXi alsa-lib pulseaudio-libs java-1.8.0-openjdk-devel && \
6-
dnf clean all
5+
xorg-x11-server-Xvfb mesa-dri-drivers libXcursor libXinerama libXrandr libXi alsa-lib pulseaudio-libs java-1.8.0-openjdk-devel
76

87
CMD /bin/bash

Dockerfile.ios

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ FROM godot-fedora:${img_version}
33

44
RUN dnf -y install --setopt=install_weak_deps=False \
55
automake autoconf clang gcc gcc-c++ gcc-objc gcc-objc++ cmake libicu-devel libtool libxml2-devel llvm-devel openssl-devel perl python yasm && \
6-
dnf clean all && \
7-
git clone https://github.com/tpoechtrager/cctools-port.git && \
6+
git clone --progress https://github.com/tpoechtrager/cctools-port.git && \
87
cd /root/cctools-port && \
98
git checkout 8239a5211bcf07d6b9d359782e1a889ec1d7cce5 && \
109
sed -i 's#./autogen.sh#libtoolize -c -i --force\n./autogen.sh#' usage_examples/ios_toolchain/build.sh && \

Dockerfile.javascript

+10-14
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,32 @@ ARG img_version
22
FROM godot-mono:${img_version}
33

44
ARG mono_version
5-
ARG mono_commit
65

7-
RUN dnf -y install --setopt=install_weak_deps=False \
6+
RUN if [ -z "${mono_version}" ]; then printf "\n\nArgument mono_version is mandatory!\n\n"; exit 1; fi && \
7+
dnf -y install --setopt=install_weak_deps=False \
88
java-openjdk yasm && \
9-
dnf clean all && \
10-
git clone https://github.com/emscripten-core/emsdk && \
9+
git clone --progress https://github.com/emscripten-core/emsdk && \
1110
cd emsdk && \
1211
git checkout a5082b232617c762cb65832429f896c838df2483 && \
1312
./emsdk install 1.38.47-upstream && \
1413
./emsdk activate 1.38.47-upstream && \
1514
echo "source /root/emsdk/emsdk_env.sh" >> /root/.bashrc
1615

17-
RUN git clone https://github.com/mono/mono --branch ${mono_version} --single-branch && \
18-
cd /root/mono && \
19-
if [ ! -z "${mono_commit}" ]; then git checkout ${mono_commit}; fi && \
20-
git submodule update --init && \
21-
git apply -3 /root/files/patches/mono-unity-Clear-TLS-instead-of-aborting.patch && \
22-
git apply -3 /root/files/patches/mono-pr16636-wasm-bugfix-and-update.diff && \
23-
export MONO_SOURCE_ROOT=/root/mono && \
16+
RUN cp -a /root/files/${mono_version} /root && \
17+
cd /root/${mono_version} && \
18+
patch -p1 < /root/files/patches/mono-pr16636-wasm-bugfix-and-update.diff && \
19+
export MONO_SOURCE_ROOT=/root/${mono_version} && \
2420
export make="make -j" && \
25-
git clone https://github.com/godotengine/godot-mono-builds /root/godot-mono-builds && \
21+
git clone --progress https://github.com/godotengine/godot-mono-builds /root/godot-mono-builds && \
2622
cd /root/godot-mono-builds && \
2723
git checkout 710b275fbf29ddb03fd5285c51782951a110cdab && \
2824
python3 patch_emscripten.py && \
2925
python3 wasm.py configure --target=runtime && \
3026
python3 wasm.py make --target=runtime && \
31-
cd /root/mono && git clean -fdx && NOCONFIGURE=1 ./autogen.sh && \
27+
cd /root/${mono_version} && git clean -fdx && NOCONFIGURE=1 ./autogen.sh && \
3228
cd /root/godot-mono-builds && \
3329
python3 bcl.py make --product wasm && \
3430
cd /root && \
35-
rm -rf /root/mono /root/godot-mono-builds
31+
rm -rf /root/${mono_version} /root/godot-mono-builds
3632

3733
CMD /bin/bash

Dockerfile.mono

+4-9
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,23 @@ ARG img_version
22
FROM godot-fedora:${img_version}
33

44
ARG mono_version
5-
ARG mono_commit
65

76
RUN if [ -z "${mono_version}" ]; then echo -e "\n\nargument mono-version is mandatory!\n\n"; exit 1; fi && \
87
dnf -y install --setopt=install_weak_deps=False \
98
autoconf automake cmake gcc gcc-c++ gettext libtool perl python && \
10-
dnf clean all && \
11-
git clone https://github.com/mono/mono --branch ${mono_version} --single-branch && \
12-
cd /root/mono && \
13-
if [ ! -z "${mono_commit}" ]; then git checkout ${mono_commit}; fi && \
14-
git submodule update --init && \
15-
git apply -3 /root/files/patches/mono-unity-Clear-TLS-instead-of-aborting.patch && \
9+
cp -a /root/files/${mono_version} /root && \
10+
cd /root/${mono_version} && \
1611
NOCONFIGURE=1 ./autogen.sh && \
1712
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var/lib/mono --disable-boehm && \
1813
make -j && \
1914
make install && \
2015
cd /root && \
16+
rm -rf /root/${mono_version} && \
2117
cert-sync /etc/pki/tls/certs/ca-bundle.crt && \
2218
rpm -ivh --nodeps \
2319
https://download.mono-project.com/repo/centos8-stable/m/msbuild/msbuild-16.3+xamarinxplat.2019.08.08.00.55-0.xamarin.2.epel8.noarch.rpm \
2420
https://download.mono-project.com/repo/centos8-stable/m/msbuild-libhostfxr/msbuild-libhostfxr-3.0.0.2019.04.16.02.13-0.xamarin.4.epel8.x86_64.rpm \
2521
https://download.mono-project.com/repo/centos8-stable/m/msbuild/msbuild-sdkresolver-16.3+xamarinxplat.2019.08.08.00.55-0.xamarin.2.epel8.noarch.rpm \
26-
https://download.mono-project.com/repo/centos8-stable/n/nuget/nuget-5.2.0.6090.bin-0.xamarin.1.epel8.noarch.rpm && \
27-
rm -rf /root/mono
22+
https://download.mono-project.com/repo/centos8-stable/n/nuget/nuget-5.2.0.6090.bin-0.xamarin.1.epel8.noarch.rpm
2823

2924
CMD /bin/bash

Dockerfile.mono-glue

+1-3
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@ ARG img_version
22
FROM godot-mono:${img_version}
33

44
ARG mono_version
5-
ARG mono_commit
65

76
RUN dnf -y install --setopt=install_weak_deps=False \
8-
xorg-x11-server-Xvfb libX11-devel libXcursor-devel libXrandr-devel libXinerama-devel libXi-devel alsa-lib-devel pulseaudio-libs-devel libudev-devel mesa-libGL-devel mesa-libGLU-devel mesa-dri-drivers && \
9-
dnf clean all
7+
xorg-x11-server-Xvfb libX11-devel libXcursor-devel libXrandr-devel libXinerama-devel libXi-devel alsa-lib-devel pulseaudio-libs-devel libudev-devel mesa-libGL-devel mesa-libGLU-devel mesa-dri-drivers
108

119
CMD /bin/bash

Dockerfile.msvc

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ ENV WINEDEBUG=-all
55

66
RUN dnf -y install --setopt=install_weak_deps=False \
77
wine winetricks xorg-x11-server-Xvfb p7zip-plugins findutils && \
8-
dnf clean all && \
98
curl -LO https://github.com/GodotBuilder/godot-builds/releases/download/_tools/angle.7z && \
109
curl -LO https://www.python.org/ftp/python/3.7.2/python-3.7.2-amd64.exe && \
1110
xvfb-run sh -c "winetricks -q vcrun2017; wineserver -w" ;\

Dockerfile.osx

+4-11
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,11 @@ ARG img_version
22
FROM godot-mono:${img_version}
33

44
ARG mono_version
5-
ARG mono_commit
65

76
RUN if [ -z "${mono_version}" ]; then echo -e "\n\nargument mono-version is mandatory!\n\n"; exit 1; fi && \
87
dnf -y install --setopt=install_weak_deps=False \
98
automake autoconf bzip2-devel clang libicu-devel libtool libxml2-devel llvm-devel openssl-devel yasm && \
10-
dnf clean all && \
11-
git clone https://github.com/tpoechtrager/osxcross.git && \
9+
git clone --progress https://github.com/tpoechtrager/osxcross.git && \
1210
cd /root/osxcross && \
1311
git checkout 542acc2ef6c21aeb3f109c03748b1015a71fed63 && \
1412
ln -s /root/files/MacOSX10.14.sdk.tar.xz /root/osxcross/tarballs && \
@@ -17,11 +15,8 @@ RUN if [ -z "${mono_version}" ]; then echo -e "\n\nargument mono-version is mand
1715
ENV OSXCROSS_ROOT=/root/osxcross
1816
ENV PATH="/root/osxcross/target/bin:${PATH}"
1917

20-
RUN git clone https://github.com/mono/mono --branch ${mono_version} --single-branch && \
21-
cd /root/mono && \
22-
if [ ! -z "${mono_commit}" ]; then git checkout ${mono_commit}; fi && \
23-
git submodule update --init && \
24-
git apply -3 /root/files/patches/mono-unity-Clear-TLS-instead-of-aborting.patch && \
18+
RUN cp -a /root/files/${mono_version} /root && \
19+
cd /root/${mono_version} && \
2520
export CMAKE=/root/osxcross/target/bin/x86_64-apple-darwin18-cmake && \
2621
NOCONFIGURE=1 ./autogen.sh && \
2722
./configure --prefix=/root/dependencies/mono \
@@ -46,8 +41,6 @@ RUN git clone https://github.com/mono/mono --branch ${mono_version} --single-bra
4641
mkdir -p /root/dependencies/mono/etc && \
4742
cp -rvp /etc/mono /root/dependencies/mono/etc/ && \
4843
cp /root/files/mono-config-macosx /root/dependencies/mono/etc/mono/config && \
49-
rm -rf /root/mono
50-
51-
ENV MONO64_PREFIX=/root/dependencies/mono
44+
rm -rf /root/${mono_version}
5245

5346
CMD /bin/bash

Dockerfile.ubuntu-32

+3-8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
FROM i386/ubuntu:trusty
22

33
ARG mono_version
4-
ARG mono_commit
54

65
RUN if [ -z "${mono_version}" ]; then echo -e "\n\nargument mono-version is mandatory!\n\n"; exit 1; fi && \
76
apt-get update && \
@@ -21,19 +20,15 @@ RUN if [ -z "${mono_version}" ]; then echo -e "\n\nargument mono-version is mand
2120
ln -sf /usr/bin/gcc-8 /usr/bin/gcc && \
2221
ln -sf /usr/bin/g++-8 /usr/bin/g++
2322

24-
RUN cd /root && \
25-
git clone https://github.com/mono/mono --branch ${mono_version} --single-branch && \
26-
cd /root/mono && \
27-
if [ ! -z "${mono_commit}" ]; then git checkout ${mono_commit}; fi && \
28-
git submodule update --init && \
29-
git apply -3 /root/files/patches/mono-unity-Clear-TLS-instead-of-aborting.patch && \
23+
RUN cp -a /root/files/${mono_version} /root && \
24+
cd /root/${mono_version} && \
3025
NOCONFIGURE=1 ./autogen.sh && \
3126
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var/lib/mono --disable-boehm --host=i386-linux-gnu && \
3227
make -j && \
3328
make install && \
3429
cd /root && \
30+
rm -rf /root/${mono_version} && \
3531
cert-sync /etc/ssl/certs/ca-certificates.crt && \
36-
rm -rf /root/mono && \
3732
wget https://download.mono-project.com/repo/ubuntu/pool/main/m/msbuild/msbuild_16.3+xamarinxplat.2019.08.08.00.55-0xamarin2+ubuntu1604b1_all.deb && \
3833
wget https://download.mono-project.com/repo/ubuntu/pool/main/c/core-setup/msbuild-libhostfxr_3.0.0.2019.04.16.02.13-0xamarin3+ubuntu1604b1_i386.deb && \
3934
wget https://download.mono-project.com/repo/ubuntu/pool/main/m/msbuild/msbuild-sdkresolver_16.3+xamarinxplat.2019.08.08.00.55-0xamarin2+ubuntu1604b1_all.deb && \

Dockerfile.ubuntu-64

+3-8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
FROM ubuntu:trusty
22

33
ARG mono_version
4-
ARG mono_commit
54

65
RUN if [ -z "${mono_version}" ]; then echo -e "\n\nargument mono-version is mandatory!\n\n"; exit 1; fi && \
76
apt-get update && \
@@ -21,19 +20,15 @@ RUN if [ -z "${mono_version}" ]; then echo -e "\n\nargument mono-version is mand
2120
ln -sf /usr/bin/gcc-8 /usr/bin/gcc && \
2221
ln -sf /usr/bin/g++-8 /usr/bin/g++
2322

24-
RUN cd /root && \
25-
git clone https://github.com/mono/mono --branch ${mono_version} --single-branch && \
26-
cd /root/mono && \
27-
if [ ! -z "${mono_commit}" ]; then git checkout ${mono_commit}; fi && \
28-
git submodule update --init && \
29-
git apply -3 /root/files/patches/mono-unity-Clear-TLS-instead-of-aborting.patch && \
23+
RUN cp -a /root/files/${mono_version} /root && \
24+
cd /root/${mono_version} && \
3025
NOCONFIGURE=1 ./autogen.sh && \
3126
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var/lib/mono --disable-boehm --host=x86_64-linux-gnu && \
3227
make -j && \
3328
make install && \
3429
cd /root && \
30+
rm -rf /root/${mono_version} && \
3531
cert-sync /etc/ssl/certs/ca-certificates.crt && \
36-
rm -rf /root/mono && \
3732
wget https://download.mono-project.com/repo/ubuntu/pool/main/m/msbuild/msbuild_16.3+xamarinxplat.2019.08.08.00.55-0xamarin2+ubuntu1604b1_all.deb && \
3833
wget https://download.mono-project.com/repo/ubuntu/pool/main/c/core-setup/msbuild-libhostfxr_3.0.0.2019.04.16.02.13-0xamarin3+ubuntu1604b1_amd64.deb && \
3934
wget https://download.mono-project.com/repo/ubuntu/pool/main/m/msbuild/msbuild-sdkresolver_16.3+xamarinxplat.2019.08.08.00.55-0xamarin2+ubuntu1604b1_all.deb && \

Dockerfile.windows

+4-12
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,13 @@ ARG img_version
22
FROM godot-mono:${img_version}
33

44
ARG mono_version
5-
ARG mono_commit
65

76
RUN if [ -z "${mono_version}" ]; then echo -e "\n\nargument mono-version is mandatory!\n\n"; exit 1; fi && \
87
dnf -y install --setopt=install_weak_deps=False \
98
mingw32-gcc mingw32-gcc-c++ mingw32-winpthreads-static mingw64-gcc mingw64-gcc-c++ mingw64-winpthreads-static yasm wine && \
10-
dnf clean all && \
11-
git clone https://github.com/mono/mono --branch ${mono_version} --single-branch && \
12-
cd /root/mono && \
13-
if [ ! -z "${mono_commit}" ]; then git checkout ${mono_commit}; fi && \
14-
git submodule update --init && \
15-
git apply -3 /root/files/patches/mono-unity-Clear-TLS-instead-of-aborting.patch && \
16-
git apply -3 /root/files/patches/wine-mono.patch && \
9+
cp -a /root/files/${mono_version} /root && \
10+
cd /root/${mono_version} && \
11+
patch -p1 < /root/files/patches/wine-mono.patch && \
1712
export WINE_BITS=64 && \
1813
bash /root/files/mono-build-win32.sh --prefix=/root/dependencies/mono-64 --host=x86_64-w64-mingw32 && \
1914
git clean -fdx && \
@@ -25,15 +20,12 @@ RUN if [ -z "${mono_version}" ]; then echo -e "\n\nargument mono-version is mand
2520
export WINE_BITS=32 && \
2621
bash /root/files/mono-build-win32.sh --prefix=/root/dependencies/mono-32 --host=i686-w64-mingw32 && \
2722
cd /root && \
23+
rm -rf /root/${mono_version} && \
2824
cp /root/dependencies/mono-32/bin/libMonoPosixHelper.dll /root/dependencies/mono-32/bin/MonoPosixHelper.dll && \
2925
rm -f /root/dependencies/mono-32/bin/mono /root/dependencies/mono-32/bin/mono-sgen && \
3026
ln -s /usr/bin/mono /root/dependencies/mono-32/bin/mono && \
3127
ln -s /usr/bin/mono-sgen /root/dependencies/mono-32/bin/mono-sgen && \
3228
cp -rvp /etc/mono /root/dependencies/mono-32/etc && \
33-
rm -rf /root/mono && \
3429
dnf -y remove wine
3530

36-
ENV MONO32_PREFIX=/root/dependencies/mono-32
37-
ENV MONO64_PREFIX=/root/dependencies/mono-64
38-
3931
CMD /bin/bash

Dockerfile.xcode

+2-3
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@ FROM godot-fedora:${img_version}
22

33
RUN dnf -y install --setopt=install_weak_deps=False \
44
autoconf automake libtool clang cmake fuse fuse-devel libxml2-devel libicu-devel compat-openssl10-devel bzip2-devel kmod cpio && \
5-
dnf clean all && \
6-
git clone https://github.com/mackyle/xar.git && \
5+
git clone --progress https://github.com/mackyle/xar.git && \
76
cd xar/xar && \
87
git checkout 66d451dab1ef859dd0c83995f2379335d35e53c9 && \
98
./autogen.sh --prefix=/usr && \
109
make -j && make install && \
1110
cd /root && \
12-
git clone https://github.com/NiklasRosenstein/pbzx && \
11+
git clone --progress https://github.com/NiklasRosenstein/pbzx && \
1312
cd pbzx && \
1413
git checkout 2a4d7c3300c826d918def713a24d25c237c8ed53 && \
1514
clang -O3 -llzma -lxar -I /usr/local/include pbzx.c -o pbzx

0 commit comments

Comments
 (0)