Skip to content

Instantly share code, notes, and snippets.

@cowlike
Last active January 8, 2018 12:58
Show Gist options
  • Save cowlike/9b64099016df3ca14ba9c218b70a8f58 to your computer and use it in GitHub Desktop.
Save cowlike/9b64099016df3ca14ba9c218b70a8f58 to your computer and use it in GitHub Desktop.
Demo dotnet app with Docker

Demo dotnet app with Docker

Create an app:

dotnet new console -o myApp
cd myApp/
dotnet publish -o publish -r linux-x64
# add Dockerfile
docker build . -t myapp:latest
docker run --rm myapp:latest

Dockerfile:

FROM microsoft/dotnet:2-runtime
WORKDIR /opt/myapp
ADD publish .
ENV PATH="/opt/myapp:${PATH}"
CMD ["myApp"]

Creating a solution with unit tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment