Skip to content

Commit

Permalink
Update ubuntu version from 18.04 to 22.04 (#216)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
eugeneteoh authored Aug 15, 2023
1 parent 3bad88c commit 9962a6a
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ jobs:
#############
- name: Build project
uses: game-ci/unity-builder@main
timeout-minutes: 15
timeout-minutes: 35
with:
unityVersion: ${{ matrix.version }}
customImage: editor:ubuntu-dev
Expand Down
21 changes: 12 additions & 9 deletions images/ubuntu/base/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG ubuntuImage="ubuntu:18.04"
ARG ubuntuImage="ubuntu:22.04"
FROM $ubuntuImage

# Fixes a Gradle crash while building for Android on Unity 2019 when there are accented characters in environment variables
Expand Down Expand Up @@ -27,12 +27,12 @@ RUN apt-get -q update \
libxss1 \
cpio \
lsb-release \
python \
python-setuptools \
xvfb \
xz-utils \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /usr/share/icons/* \
&& rm -rf /usr/lib/python3.10/__pycache__/*

# Toolbox
RUN apt-get -q update \
Expand All @@ -52,14 +52,17 @@ RUN apt-get -q update \

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

# Fix "No useable version of libssl" for Ubuntu 22.04
# https://forum.unity.com/threads/workaround-for-libssl-issue-on-ubuntu-22-04.1271405/
RUN wget http://security.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2_amd64.deb \
&& dpkg -i libssl1.1_1.1.1f-1ubuntu2_amd64.deb \
&& rm libssl1.1_1.1.1f-1ubuntu2_amd64.deb

# Disable default sound card, which removes ALSA warnings
RUN /bin/echo -e 'pcm.!default {\n\
type plug\n\
Expand Down
31 changes: 26 additions & 5 deletions images/ubuntu/editor/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,11 @@ RUN echo "$version-$module" | grep -q -v '^\(2019.3.[6-9]f\|2019.3.1[0-9]f\|2019
#=======================================================================================
RUN echo "$version-$module" | grep -q -v '^\(2020.1\|2020.2.0f\|2020.2.1f\).*-webgl' \
&& exit 0 \
|| echo 'export GZIP=-f' >> /usr/bin/unity-editor.d/webgl-2020.1-2.sh
|| : \
&& wget https://old-releases.ubuntu.com/ubuntu/pool/main/g/gzip/gzip_1.6-5ubuntu2_amd64.deb \
&& dpkg -i gzip_1.6-5ubuntu2_amd64.deb \
&& rm gzip_1.6-5ubuntu2_amd64.deb \
&& echo 'export GZIP=-f' >> /usr/bin/unity-editor.d/webgl-2020.1-2.sh


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

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

#=======================================================================================
# [2019.x] libnotify4 libunwind-dev libssl1.0
# [2019.x] libnotify4 libunwind-dev libssl1.0.0
#=======================================================================================
RUN echo "$version" | grep -q -v '^2019.' \
&& exit 0 \
Expand All @@ -253,9 +257,26 @@ RUN echo "$version" | grep -q -v '^2019.' \
&& apt-get -q install -y --no-install-recommends --allow-downgrades \
libnotify4 \
libunwind-dev \
libssl1.0 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
&& rm -rf /var/lib/apt/lists/* \
# Install libssl1.0.0
&& wget http://security.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.0.0_1.0.2g-1ubuntu4.20_amd64.deb \
&& dpkg -i libssl1.0.0_1.0.2g-1ubuntu4.20_amd64.deb \
&& rm libssl1.0.0_1.0.2g-1ubuntu4.20_amd64.deb

#=======================================================================================
# [2018.x/2019.x/2020.x/2021.1.x-webgl] python2
#=======================================================================================

RUN echo "$version-$module" | grep -q -v '^\(2018\|2019\|2020\|2021.1\).*webgl' \
&& exit 0 \
|| : \
&& apt-get -q update \
&& apt-get -q install -y --no-install-recommends --allow-downgrades \
python-setuptools \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& ln -s /usr/bin/python2 /usr/bin/python

#=======================================================================================
# [2018.x/2019.x/2020.1.x-webgl] support brotli compression for linux
Expand Down
6 changes: 3 additions & 3 deletions images/ubuntu/hub/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ RUN apt-get -q update \

# Install Unity Hub
# https://docs.unity3d.com/hub/manual/InstallHub.html#install-hub-linux
RUN sh -c 'echo "deb https://hub.unity3d.com/linux/repos/deb stable main" > /etc/apt/sources.list.d/unityhub.list' \
&& sh -c 'echo "deb https://hub.unity3d.com/linux/repos/deb unstable main" > /etc/apt/sources.list.d/unityhub-beta.list' \
&& wget -qO - https://hub.unity3d.com/linux/keys/public | apt-key add - \
RUN wget -qO - https://hub.unity3d.com/linux/keys/public | gpg --dearmor | tee /usr/share/keyrings/Unity_Technologies_ApS.gpg > /dev/null \
&& 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' \
&& 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' \
&& apt-get -q update \
&& apt-get -q install -y "unityhub=$hubVersion" \
&& apt-get clean
Expand Down

0 comments on commit 9962a6a

Please sign in to comment.