Skip to content

alextanhongpin/dotnetcore-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Microservices with .NET Core 2

Init

# Create a new app in the current directory
$ dotnet new console

# Create a new app in the folder myApp
$ dotnet new console -o myApp

Publish

$ dotnet publish -o app

Restore

$ dotnet restore

Dockerize

Create a .dockerignore:

bin\
obj\
FROM microsoft/apsnetcore-build:2.0 AS build-env
WORKDIR /app

# Copy csproj and restore as distinct layers
COPY *.csproj ./
RUN dotnet restore

# Copy everything else and build
COPY . ./
RUN dotnet publish -c Release -o out

# Build runtime image
FROM microsoft/aspnetcore:2.0
WORKDIR /app
COPY --from=build-env /app/out .
ENTRYPOINT ["dotnet", "microservice.dll"]

About

.NET Core 2 with Docker

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published