diff --git a/.gitignore b/.gitignore index 0deed635b..15d53c3ea 100644 --- a/.gitignore +++ b/.gitignore @@ -184,4 +184,10 @@ PortabilityAnalysis*.html tools !tools/packages.config extension-packages -zip-image \ No newline at end of file +zip-image + +# ========================= +# Docker Mono build packages +# ========================= + +*.deb \ No newline at end of file diff --git a/BUILDING.md b/BUILDING.md index bcd15c892..646fb8e94 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -82,8 +82,10 @@ One convenient way to do this is to pass the same arguments to For example, to build and test everything: `.\build-mono-docker.ps1 -t test` -This will run a temporary container using a custom -[rprouse/nunit-docker](https://hub.docker.com/r/rprouse/nunit-docker/) image +This will build a docker image and run a temporary container based on the [Mono image](https://hub.docker.com/r/library/mono/) and adding in .NET Core. The script mounts the repo inside the container and executes the [build.sh](build.sh) Cake bootstrapper with the arguments you specify. + +The first build will be slow as it builds the new image, but subsequent runs will +be much quicker. diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..e10737365 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +FROM mono:6.6.0 + +# Install .NET Core +RUN apt-get update && \ + apt-get -y install wget && \ + wget -q https://packages.microsoft.com/config/ubuntu/16.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb && \ + dpkg -i packages-microsoft-prod.deb && \ + apt-get -y install apt-transport-https && \ + apt-get update && \ + apt-get -y install dotnet-sdk-2.2 \ No newline at end of file diff --git a/build-mono-docker.ps1 b/build-mono-docker.ps1 index a38441da7..eebebdb10 100644 --- a/build-mono-docker.ps1 +++ b/build-mono-docker.ps1 @@ -4,4 +4,5 @@ trap [Management.Automation.CommandNotFoundException] { continue; } -docker run --rm -it -v ${PSScriptRoot}:/nunit-console -w=/nunit-console rprouse/nunit-docker:latest bash build.sh $args \ No newline at end of file +docker build -t nunit-console-build . +docker run --rm -it -v ${PSScriptRoot}:/nunit-console -w=/nunit-console nunit-console-build bash build.sh $args \ No newline at end of file