Skip to content

Commit

Permalink
added docker support
Browse files Browse the repository at this point in the history
  • Loading branch information
irongut committed Apr 15, 2021
1 parent 53dbb76 commit 15a9b16
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
**/.classpath
**/.dockerignore
**/.env
**/.git
**/.gitignore
**/.project
**/.settings
**/.toolstarget
**/.vs
**/.vscode
**/*.*proj.user
**/*.dbmdl
**/*.jfm
**/azds.yaml
**/bin
**/charts
**/docker-compose*
**/Dockerfile*
**/node_modules
**/npm-debug.log
**/obj
**/secrets.dev.yaml
**/values.dev.yaml
LICENSE
README.md
2 changes: 2 additions & 0 deletions src/CodeCoverageSummary/CodeCoverageSummary.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="CommandLineParser" Version="2.8.0" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.10.13" />
</ItemGroup>

</Project>
20 changes: 20 additions & 0 deletions src/CodeCoverageSummary/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.

FROM mcr.microsoft.com/dotnet/runtime:5.0 AS base
WORKDIR /app

FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
WORKDIR /src
COPY ["CodeCoverageSummary/CodeCoverageSummary.csproj", "CodeCoverageSummary/"]
RUN dotnet restore "CodeCoverageSummary/CodeCoverageSummary.csproj"
COPY . .
WORKDIR "/src/CodeCoverageSummary"
RUN dotnet build "CodeCoverageSummary.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "CodeCoverageSummary.csproj" -c Release -o /app/publish

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "CodeCoverageSummary.dll"]
11 changes: 11 additions & 0 deletions src/CodeCoverageSummary/Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"profiles": {
"CodeCoverageSummary": {
"commandName": "Project"
},
"Docker": {
"commandName": "Docker",
"commandLineArgs": "/src/coverage.cobertura.xml --format=md --badge=true"
}
}
}

0 comments on commit 15a9b16

Please sign in to comment.