Skip to content

Commit

Permalink
perf: Faster mono installation (#8)
Browse files Browse the repository at this point in the history
avoid running apt update twice
cleanup packages after installing mono
  • Loading branch information
paulpach authored Mar 8, 2021
1 parent 5c0cf59 commit 5067deb
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@ LABEL "repository"="http://github.com/MirrorNG/unity-runner"
LABEL "homepage"="http://github.com/MirrorNG/unity-runner"
LABEL "maintainer"="Paul Pacheco <paulpach@gmail.com>"

RUN apt-get update && \
apt-get install -y --no-install-recommends default-jre unzip && \
RUN apt install gnupg ca-certificates && \
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF && \
echo "deb https://download.mono-project.com/repo/ubuntu stable-bionic main" | tee /etc/apt/sources.list.d/mono-official-stable.list && \
apt-get update && \
apt-get install -y --no-install-recommends default-jre unzip mono-devel && \
rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/* && \
apt-get autoremove -y

Expand All @@ -20,19 +23,11 @@ RUN /opt/Unity/Editor/Data/NetCore/Sdk-2.2.107/dotnet tool install dotnet-sonars
COPY unity_csc.sh.patch .
RUN patch /opt/Unity/Editor/Data/Tools/RoslynScripts/unity_csc.sh unity_csc.sh.patch

# install mono
RUN apt install gnupg ca-certificates && \
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF && \
echo "deb https://download.mono-project.com/repo/ubuntu stable-bionic main" | tee /etc/apt/sources.list.d/mono-official-stable.list && \
apt update && \
apt install -y mono-devel

# install docfx
RUN wget https://github.com/dotnet/docfx/releases/download/v2.56.6/docfx.zip && \
unzip docfx.zip -d /docfx && \
rm docfx.zip


COPY entrypoint.sh activate.sh sonar-scanner.sh request_activation.sh docfx.sh /

ENV DOTNET_ROOT=/opt/Unity/Editor/Data/NetCore/Sdk-2.2.107/
Expand Down

0 comments on commit 5067deb

Please sign in to comment.