Skip to content

Commit cb0e006

Browse files
committedDec 20, 2019
Add a Dockerfile to the project to allow building on Linux
1 parent 033c7c4 commit cb0e006

4 files changed

+17
-4
lines changed
 

‎BUILDING.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,10 @@ One convenient way to do this is to pass the same arguments to
8282

8383
For example, to build and test everything: `.\build-mono-docker.ps1 -t test`
8484

85-
This will run a temporary container using a custom
86-
[rprouse/nunit-docker](https://hub.docker.com/r/rprouse/nunit-docker/) image
85+
This will build a docker image and run a temporary container
8786
based on the [Mono image](https://hub.docker.com/r/library/mono/) and adding in
8887
.NET Core. The script mounts the repo inside the container and executes the
8988
[build.sh](build.sh) Cake bootstrapper with the arguments you specify.
89+
90+
The first build will be slow as it builds the new image, but subsequent runs will
91+
be much quicker.

‎Dockerfile

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM mono:6.6.0
2+
3+
# Install .NET Core
4+
RUN apt-get update && \
5+
apt-get -y install wget && \
6+
wget -q https://packages.microsoft.com/config/ubuntu/16.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb && \
7+
dpkg -i packages-microsoft-prod.deb && \
8+
apt-get -y install apt-transport-https && \
9+
apt-get update && \
10+
apt-get -y install dotnet-sdk-2.2

‎build-mono-docker.ps1

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
trap [Management.Automation.CommandNotFoundException] {
1+
if ($null -eq (Get-Command "docker.exe" -ErrorAction SilentlyContinue)) {
22
Write-Error 'Docker cannot be found. Make sure it is installed and added to the path.'
33
Start-Process -FilePath 'https://docs.docker.com/docker-for-windows/install/'
44
continue;
55
}
66

7-
docker run --rm -it -v ${PSScriptRoot}:/nunit-console -w=/nunit-console rprouse/nunit-docker:latest bash build.sh $args
7+
docker build -t nunit-console-build .
8+
docker run --rm -it -v ${PSScriptRoot}:/nunit-console -w=/nunit-console nunit-console-build bash build.sh $args

‎packages-microsoft-prod.deb

2.39 KB
Binary file not shown.

0 commit comments

Comments
 (0)
Please sign in to comment.