Skip to content

Commit 9962a6a

Browse files
authored
Update ubuntu version from 18.04 to 22.04 (#216)
* Update base image to ubuntu 22.04 and fix dependencies * Replace python3 with python-is-python3 * Clear python cache and icons * Remove build-essentials Reduces docker image size from 467Mb to 485Mb * Add libssl fix for Ubuntu 22.04 * Trigger build * Add apt-get install flags * Increase build timeout * Install libssl1.1 and libssl1.0.0 from focal and bionic deb package repositories * Install libssl directly from source * Remove libssl1.0.0 from apt-get install * Fix brotli compression by installing python-setuptools * Update unityhub installation as apt-key is deprecated * Add unstable unityhub distribution * Increase build timeout * Add python2 symlink * Instal python2 for failed builds * Downgrade gzip version * Install python2 from python-setuptools * Minor bug fix
1 parent 3bad88c commit 9962a6a

File tree

4 files changed

+42
-18
lines changed

4 files changed

+42
-18
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ jobs:
356356
#############
357357
- name: Build project
358358
uses: game-ci/unity-builder@main
359-
timeout-minutes: 15
359+
timeout-minutes: 35
360360
with:
361361
unityVersion: ${{ matrix.version }}
362362
customImage: editor:ubuntu-dev

images/ubuntu/base/Dockerfile

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG ubuntuImage="ubuntu:18.04"
1+
ARG ubuntuImage="ubuntu:22.04"
22
FROM $ubuntuImage
33

44
# Fixes a Gradle crash while building for Android on Unity 2019 when there are accented characters in environment variables
@@ -27,12 +27,12 @@ RUN apt-get -q update \
2727
libxss1 \
2828
cpio \
2929
lsb-release \
30-
python \
31-
python-setuptools \
3230
xvfb \
3331
xz-utils \
3432
&& apt-get clean \
35-
&& rm -rf /var/lib/apt/lists/*
33+
&& rm -rf /var/lib/apt/lists/* \
34+
&& rm -rf /usr/share/icons/* \
35+
&& rm -rf /usr/lib/python3.10/__pycache__/*
3636

3737
# Toolbox
3838
RUN apt-get -q update \
@@ -52,14 +52,17 @@ RUN apt-get -q update \
5252

5353
# libstdc++6 upgrade
5454
RUN apt-get -q update \
55-
&& apt-get -q install -y --no-install-recommends software-properties-common \
56-
&& add-apt-repository -y ppa:ubuntu-toolchain-r/test \
57-
&& apt-get -q install -y --only-upgrade libstdc++6 \
58-
&& add-apt-repository -y --remove ppa:ubuntu-toolchain-r/test \
59-
&& apt-get -q remove -y --auto-remove software-properties-common \
55+
&& apt-get install -y --no-install-recommends --allow-downgrades \
56+
libstdc++6 \
6057
&& apt-get clean \
6158
&& rm -rf /var/lib/apt/lists/*
6259

60+
# Fix "No useable version of libssl" for Ubuntu 22.04
61+
# https://forum.unity.com/threads/workaround-for-libssl-issue-on-ubuntu-22-04.1271405/
62+
RUN wget http://security.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2_amd64.deb \
63+
&& dpkg -i libssl1.1_1.1.1f-1ubuntu2_amd64.deb \
64+
&& rm libssl1.1_1.1.1f-1ubuntu2_amd64.deb
65+
6366
# Disable default sound card, which removes ALSA warnings
6467
RUN /bin/echo -e 'pcm.!default {\n\
6568
type plug\n\

images/ubuntu/editor/Dockerfile

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,11 @@ RUN echo "$version-$module" | grep -q -v '^\(2019.3.[6-9]f\|2019.3.1[0-9]f\|2019
8585
#=======================================================================================
8686
RUN echo "$version-$module" | grep -q -v '^\(2020.1\|2020.2.0f\|2020.2.1f\).*-webgl' \
8787
&& exit 0 \
88-
|| echo 'export GZIP=-f' >> /usr/bin/unity-editor.d/webgl-2020.1-2.sh
88+
|| : \
89+
&& wget https://old-releases.ubuntu.com/ubuntu/pool/main/g/gzip/gzip_1.6-5ubuntu2_amd64.deb \
90+
&& dpkg -i gzip_1.6-5ubuntu2_amd64.deb \
91+
&& rm gzip_1.6-5ubuntu2_amd64.deb \
92+
&& echo 'export GZIP=-f' >> /usr/bin/unity-editor.d/webgl-2020.1-2.sh
8993

9094

9195
###########################
@@ -231,7 +235,7 @@ RUN echo "$module" | grep -q -v 'webgl' \
231235
&& rm -rf /var/lib/apt/lists/*
232236

233237
#=======================================================================================
234-
# [webgl, il2cpp] python python-setuptools build-essential clang
238+
# [webgl, il2cpp] build-essential clang
235239
#=======================================================================================
236240
RUN echo "$module" | grep -q -v '\(webgl\|linux-il2cpp\)' \
237241
&& exit 0 \
@@ -244,7 +248,7 @@ RUN echo "$module" | grep -q -v '\(webgl\|linux-il2cpp\)' \
244248
&& rm -rf /var/lib/apt/lists/*
245249

246250
#=======================================================================================
247-
# [2019.x] libnotify4 libunwind-dev libssl1.0
251+
# [2019.x] libnotify4 libunwind-dev libssl1.0.0
248252
#=======================================================================================
249253
RUN echo "$version" | grep -q -v '^2019.' \
250254
&& exit 0 \
@@ -253,9 +257,26 @@ RUN echo "$version" | grep -q -v '^2019.' \
253257
&& apt-get -q install -y --no-install-recommends --allow-downgrades \
254258
libnotify4 \
255259
libunwind-dev \
256-
libssl1.0 \
257260
&& apt-get clean \
258-
&& rm -rf /var/lib/apt/lists/*
261+
&& rm -rf /var/lib/apt/lists/* \
262+
# Install libssl1.0.0
263+
&& wget http://security.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.0.0_1.0.2g-1ubuntu4.20_amd64.deb \
264+
&& dpkg -i libssl1.0.0_1.0.2g-1ubuntu4.20_amd64.deb \
265+
&& rm libssl1.0.0_1.0.2g-1ubuntu4.20_amd64.deb
266+
267+
#=======================================================================================
268+
# [2018.x/2019.x/2020.x/2021.1.x-webgl] python2
269+
#=======================================================================================
270+
271+
RUN echo "$version-$module" | grep -q -v '^\(2018\|2019\|2020\|2021.1\).*webgl' \
272+
&& exit 0 \
273+
|| : \
274+
&& apt-get -q update \
275+
&& apt-get -q install -y --no-install-recommends --allow-downgrades \
276+
python-setuptools \
277+
&& apt-get clean \
278+
&& rm -rf /var/lib/apt/lists/* \
279+
&& ln -s /usr/bin/python2 /usr/bin/python
259280

260281
#=======================================================================================
261282
# [2018.x/2019.x/2020.1.x-webgl] support brotli compression for linux

images/ubuntu/hub/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ RUN apt-get -q update \
99

1010
# Install Unity Hub
1111
# https://docs.unity3d.com/hub/manual/InstallHub.html#install-hub-linux
12-
RUN sh -c 'echo "deb https://hub.unity3d.com/linux/repos/deb stable main" > /etc/apt/sources.list.d/unityhub.list' \
13-
&& sh -c 'echo "deb https://hub.unity3d.com/linux/repos/deb unstable main" > /etc/apt/sources.list.d/unityhub-beta.list' \
14-
&& wget -qO - https://hub.unity3d.com/linux/keys/public | apt-key add - \
12+
RUN wget -qO - https://hub.unity3d.com/linux/keys/public | gpg --dearmor | tee /usr/share/keyrings/Unity_Technologies_ApS.gpg > /dev/null \
13+
&& sh -c 'echo "deb [signed-by=/usr/share/keyrings/Unity_Technologies_ApS.gpg] https://hub.unity3d.com/linux/repos/deb stable main" > /etc/apt/sources.list.d/unityhub.list' \
14+
&& sh -c 'echo "deb [signed-by=/usr/share/keyrings/Unity_Technologies_ApS.gpg] https://hub.unity3d.com/linux/repos/deb unstable main" > /etc/apt/sources.list.d/unityhub-beta.list' \
1515
&& apt-get -q update \
1616
&& apt-get -q install -y "unityhub=$hubVersion" \
1717
&& apt-get clean

0 commit comments

Comments
 (0)