Skip to content

Instantly share code, notes, and snippets.

@johnkors
Created August 7, 2018 11:34
Show Gist options
  • Save johnkors/b59f4e88a9f66416d39b04f09f481704 to your computer and use it in GitHub Desktop.
Save johnkors/b59f4e88a9f66416d39b04f09f481704 to your computer and use it in GitHub Desktop.
Dockerfile to build .NET Core using Cake on Ubuntu (Mono+Git+.NET SDK)
FROM ubuntu:16.04
ENV DOTNET_CLI_TELEMETRY_OPTOUT 1
ENV DOTNET_SKIP_FIRST_TIME_EXPERIENCE 1
# Enable SSL
RUN apt-get update \
&& apt-get install -y apt-transport-https curl tzdata git \
&& apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF \
&& echo "deb http://download.mono-project.com/repo/ubuntu stable-xenial main" | tee /etc/apt/sources.list.d/mono-official-stable.list \
&& curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \
&& sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-xenial-prod xenial main" > /etc/apt/sources.list.d/dotnetdev.list' \
&& apt-get update \
&& apt-get install -y --no-install-recommends unzip mono-devel libcurl3 \
&& apt-get clean \
&& mkdir -p /opt/nuget \
&& curl -Lsfo /opt/nuget/nuget.exe https://dist.nuget.org/win-x86-commandline/latest/nuget.exe
# Install .NET Core
RUN apt-get install -y --no-install-recommends dotnet-sdk-2.1
RUN mkdir warmup \
&& cd warmup \
&& dotnet new \
&& cd .. \
&& rm -rf warmup \
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment