Skip to content
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
20 changes: 20 additions & 0 deletions StandAlone.NETCoreApp/Dockerfile.windows-2019
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM mcr.microsoft.com/dotnet/core/sdk:2.2 AS build-env

LABEL maintainer="Stef Heyenrath"

WORKDIR /app

# copy csproj and restore as distinct layers
COPY StandAlone.NETCoreApp.csproj ./
RUN dotnet restore

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

# build runtime image
FROM mcr.microsoft.com/dotnet/core/aspnet:2.2
WORKDIR /app
COPY --from=build-env /app/out ./
EXPOSE 80
ENTRYPOINT ["dotnet", "wiremock-net.dll", "--Urls", "http://*:80", "--ReadStaticMappings", "false"]
1 change: 1 addition & 0 deletions WireMock.Net Docker Solution.sln
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StandAlone.NETCoreApp", "St
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{5AC62511-0096-4DE2-A53D-A899F8F5FD4A}"
ProjectSection(SolutionItems) = preProject
azure-pipelines-windows-2019.yml = azure-pipelines-windows-2019.yml
azure-pipelines.nano.yml = azure-pipelines.nano.yml
azure-pipelines.yml = azure-pipelines.yml
GitHubReleaseNotes.txt = GitHubReleaseNotes.txt
Expand Down
37 changes: 37 additions & 0 deletions azure-pipelines-windows-2019.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
pool:
vmImage: 'win1803'

variables:
buildConfiguration: 'Release'
imageName: 'wiremock.net-windows-2019'
buildProjects: '**/StandAlone.NETCoreApp.csproj'
tag: '1.0.16'

steps:
# Build StandAlone.NETCoreApp
- task: DotNetCoreCLI@2
displayName: Build StandAlone.NETCoreApp
inputs:
command: 'build'
arguments: /p:Configuration=$(buildConfiguration)
projects: $(buildProjects)

# Docker
- script: docker build -t $(DOCKER_ID)/$(imageName) -f ./StandAlone.NETCoreApp/Dockerfile.windows-2019 ./StandAlone.NETCoreApp
displayName: 'Build Docker image [$(imageName):latest]'

- script: docker tag $(DOCKER_ID)/$(imageName):latest $(DOCKER_ID)/$(imageName):$(tag)
displayName: 'Tag Docker image [$(imageName):$(tag)]'


# for vs2017-win2016 only !
# https://stackoverflow.com/questions/51489359/docker-using-password-via-the-cli-is-insecure-use-password-stdin
# https://github.com/Microsoft/azure-pipelines-tasks/issues/6480#issuecomment-453765536
# echo | set /p="$(DOCKER_PWD)" | docker login --username $(DOCKER_ID) --password-stdin

# For win1803 ; just use --password
- script: |
docker login --username $(DOCKER_ID) --password $(DOCKER_PWD)
docker push $(DOCKER_ID)/$(imageName):latest
docker push $(DOCKER_ID)/$(imageName):$(tag)
displayName: 'Push Docker image [$(imageName)(latest,$(tag)]'