Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a Dockerfile to the project to allow building on Linux #716

Merged
merged 3 commits into from
Jan 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -184,4 +184,10 @@ PortabilityAnalysis*.html
tools
!tools/packages.config
extension-packages
zip-image
zip-image

# =========================
# Docker Mono build packages
# =========================

*.deb
6 changes: 4 additions & 2 deletions BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
10 changes: 10 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
3 changes: 2 additions & 1 deletion build-mono-docker.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
docker build -t nunit-console-build .
docker run --rm -it -v ${PSScriptRoot}:/nunit-console -w=/nunit-console nunit-console-build bash build.sh $args