├── .github
└── FUNDING.yml
├── .gitignore
├── Docker Compose Examples
├── Linux - Alpine 2
│ └── docker-compose.yml
├── Linux - Alpine
│ └── docker-compose.yml
└── Linux
│ └── docker-compose.yml
├── GitHubReleaseNotes.txt
├── Kubernetes Examples
├── kubernetes-deployment.yml
├── kubernetes-pod.yml
├── kubernetes-rs.yml
└── kubernetes.yml
├── LICENSE
├── OLD.nuget.config
├── README.md
├── ReleaseNotes.md
├── StandAlone.NETCoreApp.Local
├── .dockerignore
├── Dockerfile
├── Dockerfile.alpine
├── Dockerfile.arm-32
├── Dockerfile.arm-64
├── Dockerfile.nanoserver-1809
├── Dockerfile.nanoserver-1903
├── Dockerfile.nanoserver-1909
├── Dockerfile.nanoserver-2022
├── Dockerfile.windows
├── Dockerfile.windows-2019
├── Program.cs
├── StandAlone.NETCoreApp.Local.csproj
├── WireMock.Net-Logo.ico
├── create.alpine.ps1
├── nuget.config
└── nuget.config.Docker
├── StandAlone.NETCoreApp
├── .dockerignore
├── Dockerfile
├── Dockerfile.alpine
├── Dockerfile.arm-32
├── Dockerfile.arm-64
├── Dockerfile.nanoserver-1809
├── Dockerfile.nanoserver-1903
├── Dockerfile.nanoserver-1909
├── Dockerfile.nanoserver-2022
├── Dockerfile.windows
├── Dockerfile.windows-2019
├── Program.cs
├── StandAlone.NETCoreApp.csproj
├── WireMock.Net-Logo.ico
├── create.alpine.ps1
├── create.nanoserver-1809.ps1
├── create.nanoserver-1903.ps1
├── create.nanoserver-1909.ps1
├── create.ps1
├── create.windows-2019.ps1
└── create_how_to.md
├── WireMock.Net Docker Solution.sln
├── azure-pipelines-alpine.yml
├── azure-pipelines-arm.yml
├── azure-pipelines-windows-2019.yml
├── azure-pipelines-windows.yml
├── azure-pipelines.nano.yml
├── azure-pipelines.yml
└── trivy.cmd
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | # These are supported funding model platforms
2 |
3 | github: [StefH]
4 | patreon: # Replace with a single Patreon username
5 | open_collective: # wiremocknet
6 | ko_fi: # Replace with a single Ko-fi username
7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9 | liberapay: # Replace with a single Liberapay username
10 | issuehunt: # Replace with a single IssueHunt username
11 | otechie: # Replace with a single Otechie username
12 | custom: https://www.paypal.me/stefheyenrath
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 | ##
4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
5 |
6 | # User-specific files
7 | *.suo
8 | *.user
9 | *.userosscache
10 | *.sln.docstates
11 |
12 | # User-specific files (MonoDevelop/Xamarin Studio)
13 | *.userprefs
14 |
15 | # Build results
16 | [Dd]ebug/
17 | [Dd]ebugPublic/
18 | [Rr]elease/
19 | [Rr]eleases/
20 | x64/
21 | x86/
22 | bld/
23 | [Bb]in/
24 | [Oo]bj/
25 | [Ll]og/
26 |
27 | # Visual Studio 2015 cache/options directory
28 | .vs/
29 | # Uncomment if you have tasks that create the project's static files in wwwroot
30 | #wwwroot/
31 |
32 | # MSTest test Results
33 | [Tt]est[Rr]esult*/
34 | [Bb]uild[Ll]og.*
35 |
36 | # NUNIT
37 | *.VisualState.xml
38 | TestResult.xml
39 |
40 | # Build Results of an ATL Project
41 | [Dd]ebugPS/
42 | [Rr]eleasePS/
43 | dlldata.c
44 |
45 | # .NET Core
46 | project.lock.json
47 | project.fragment.lock.json
48 | artifacts/
49 | **/Properties/launchSettings.json
50 |
51 | *_i.c
52 | *_p.c
53 | *_i.h
54 | *.ilk
55 | *.meta
56 | *.obj
57 | *.pch
58 | *.pdb
59 | *.pgc
60 | *.pgd
61 | *.rsp
62 | *.sbr
63 | *.tlb
64 | *.tli
65 | *.tlh
66 | *.tmp
67 | *.tmp_proj
68 | *.log
69 | *.vspscc
70 | *.vssscc
71 | .builds
72 | *.pidb
73 | *.svclog
74 | *.scc
75 |
76 | # Chutzpah Test files
77 | _Chutzpah*
78 |
79 | # Visual C++ cache files
80 | ipch/
81 | *.aps
82 | *.ncb
83 | *.opendb
84 | *.opensdf
85 | *.sdf
86 | *.cachefile
87 | *.VC.db
88 | *.VC.VC.opendb
89 |
90 | # Visual Studio profiler
91 | *.psess
92 | *.vsp
93 | *.vspx
94 | *.sap
95 |
96 | # TFS 2012 Local Workspace
97 | $tf/
98 |
99 | # Guidance Automation Toolkit
100 | *.gpState
101 |
102 | # ReSharper is a .NET coding add-in
103 | _ReSharper*/
104 | *.[Rr]e[Ss]harper
105 | *.DotSettings.user
106 |
107 | # JustCode is a .NET coding add-in
108 | .JustCode
109 |
110 | # TeamCity is a build add-in
111 | _TeamCity*
112 |
113 | # DotCover is a Code Coverage Tool
114 | *.dotCover
115 |
116 | # Visual Studio code coverage results
117 | *.coverage
118 | *.coveragexml
119 |
120 | # NCrunch
121 | _NCrunch_*
122 | .*crunch*.local.xml
123 | nCrunchTemp_*
124 |
125 | # MightyMoose
126 | *.mm.*
127 | AutoTest.Net/
128 |
129 | # Web workbench (sass)
130 | .sass-cache/
131 |
132 | # Installshield output folder
133 | [Ee]xpress/
134 |
135 | # DocProject is a documentation generator add-in
136 | DocProject/buildhelp/
137 | DocProject/Help/*.HxT
138 | DocProject/Help/*.HxC
139 | DocProject/Help/*.hhc
140 | DocProject/Help/*.hhk
141 | DocProject/Help/*.hhp
142 | DocProject/Help/Html2
143 | DocProject/Help/html
144 |
145 | # Click-Once directory
146 | publish/
147 |
148 | # Publish Web Output
149 | *.[Pp]ublish.xml
150 | *.azurePubxml
151 | # TODO: Comment the next line if you want to checkin your web deploy settings
152 | # but database connection strings (with potential passwords) will be unencrypted
153 | *.pubxml
154 | *.publishproj
155 |
156 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
157 | # checkin your Azure Web App publish settings, but sensitive information contained
158 | # in these scripts will be unencrypted
159 | PublishScripts/
160 |
161 | # NuGet Packages
162 | *.nupkg
163 | # The packages folder can be ignored because of Package Restore
164 | **/packages/*
165 | # except build/, which is used as an MSBuild target.
166 | !**/packages/build/
167 | # Uncomment if necessary however generally it will be regenerated when needed
168 | #!**/packages/repositories.config
169 | # NuGet v3's project.json files produces more ignorable files
170 | *.nuget.props
171 | *.nuget.targets
172 |
173 | # Microsoft Azure Build Output
174 | csx/
175 | *.build.csdef
176 |
177 | # Microsoft Azure Emulator
178 | ecf/
179 | rcf/
180 |
181 | # Windows Store app package directories and files
182 | AppPackages/
183 | BundleArtifacts/
184 | Package.StoreAssociation.xml
185 | _pkginfo.txt
186 |
187 | # Visual Studio cache files
188 | # files ending in .cache can be ignored
189 | *.[Cc]ache
190 | # but keep track of directories ending in .cache
191 | !*.[Cc]ache/
192 |
193 | # Others
194 | ClientBin/
195 | ~$*
196 | *~
197 | *.dbmdl
198 | *.dbproj.schemaview
199 | *.jfm
200 | *.pfx
201 | *.publishsettings
202 | orleans.codegen.cs
203 |
204 | # Since there are multiple workflows, uncomment next line to ignore bower_components
205 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
206 | #bower_components/
207 |
208 | # RIA/Silverlight projects
209 | Generated_Code/
210 |
211 | # Backup & report files from converting an old project file
212 | # to a newer Visual Studio version. Backup files are not needed,
213 | # because we have git ;-)
214 | _UpgradeReport_Files/
215 | Backup*/
216 | UpgradeLog*.XML
217 | UpgradeLog*.htm
218 |
219 | # SQL Server files
220 | *.mdf
221 | *.ldf
222 | *.ndf
223 |
224 | # Business Intelligence projects
225 | *.rdl.data
226 | *.bim.layout
227 | *.bim_*.settings
228 |
229 | # Microsoft Fakes
230 | FakesAssemblies/
231 |
232 | # GhostDoc plugin setting file
233 | *.GhostDoc.xml
234 |
235 | # Node.js Tools for Visual Studio
236 | .ntvs_analysis.dat
237 | node_modules/
238 |
239 | # Typescript v1 declaration files
240 | typings/
241 |
242 | # Visual Studio 6 build log
243 | *.plg
244 |
245 | # Visual Studio 6 workspace options file
246 | *.opt
247 |
248 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
249 | *.vbw
250 |
251 | # Visual Studio LightSwitch build output
252 | **/*.HTMLClient/GeneratedArtifacts
253 | **/*.DesktopClient/GeneratedArtifacts
254 | **/*.DesktopClient/ModelManifest.xml
255 | **/*.Server/GeneratedArtifacts
256 | **/*.Server/ModelManifest.xml
257 | _Pvt_Extensions
258 |
259 | # Paket dependency manager
260 | .paket/paket.exe
261 | paket-files/
262 |
263 | # FAKE - F# Make
264 | .fake/
265 |
266 | # JetBrains Rider
267 | .idea/
268 | *.sln.iml
269 |
270 | # CodeRush
271 | .cr/
272 |
273 | # Python Tools for Visual Studio (PTVS)
274 | __pycache__/
275 | *.pyc
276 |
277 | # Cake - Uncomment if you are using it
278 | # tools/**
279 | # !tools/packages.config
280 |
281 | # Telerik's JustMock configuration file
282 | *.jmconfig
283 |
284 | # BizTalk build output
285 | *.btp.cs
286 | *.btm.cs
287 | *.odx.cs
288 | *.xsd.cs\
289 |
290 | temp/
291 | latest/
292 |
293 | .kube
--------------------------------------------------------------------------------
/Docker Compose Examples/Linux - Alpine 2/docker-compose.yml:
--------------------------------------------------------------------------------
1 | services:
2 | fake-service:
3 | image: sheyenrath/wiremock.net-alpine:latest
4 | container_name: fake-service
5 | volumes:
6 | - ./mappings.json:/app/__admin/mappings/mappings.json
7 | command: [
8 | "dotnet",
9 | "wiremock-net.dll",
10 | "--Urls", "http://*:80 http://*:9009",
11 | "--ReadStaticMappings", "true",
12 | "--WireMockLogger", "WireMockConsoleLogger",
13 | "--Port", "9009" ]
14 | healthcheck:
15 | test: [ "CMD-SHELL", "wget --spider -O /dev/null localhost:9009/healthz" ]
16 | interval: 30s
17 | start_period: 30s
18 | ports:
19 | - 9009:9009
--------------------------------------------------------------------------------
/Docker Compose Examples/Linux - Alpine/docker-compose.yml:
--------------------------------------------------------------------------------
1 | version: "3.8"
2 |
3 | services:
4 | wiremock:
5 | image: sheyenrath/wiremock.net-alpine
6 | ports:
7 | - "9091:80"
8 | volumes:
9 | - ./wiremock/mappings:/app/__admin/mappings
10 | command: ["dotnet", "wiremock-net.dll", "--Urls", "http://*:80", "--ReadStaticMappings", "true", "--WireMockLogger", "WireMockConsoleLogger"]
--------------------------------------------------------------------------------
/Docker Compose Examples/Linux/docker-compose.yml:
--------------------------------------------------------------------------------
1 | version: "3.8"
2 |
3 | services:
4 | wiremock:
5 | image: sheyenrath/wiremock.net
6 | ports:
7 | - "9091:80"
8 | volumes:
9 | - ./wiremock/mappings:/app/__admin/mappings
10 | command: ["dotnet", "wiremock-net.dll", "--Urls", "http://*:80", "--ReadStaticMappings", "true", "--WireMockLogger", "WireMockConsoleLogger"]
--------------------------------------------------------------------------------
/GitHubReleaseNotes.txt:
--------------------------------------------------------------------------------
1 | https://github.com/StefH/GitHubReleaseNotes
2 |
3 | GitHubReleaseNotes --output ReleaseNotes.md --language en --version 1.8.5
--------------------------------------------------------------------------------
/Kubernetes Examples/kubernetes-deployment.yml:
--------------------------------------------------------------------------------
1 | # kubectl create -f kubernetes-deployment.yml
2 | apiVersion: apps/v1
3 | kind: Deployment
4 | metadata:
5 | name: wiremock-net-dp
6 | labels:
7 | app: wiremock
8 | tier: frontend
9 | spec:
10 | replicas: 10
11 | selector:
12 | matchLabels:
13 | tier: frontend
14 | template:
15 | metadata:
16 | name: wiremock-net
17 | labels:
18 | tier: frontend
19 | spec:
20 | containers:
21 | - name: wiremock-net
22 | image: sheyenrath/wiremock.net:1.8.5
--------------------------------------------------------------------------------
/Kubernetes Examples/kubernetes-pod.yml:
--------------------------------------------------------------------------------
1 | # kubectl create -f kubernetes-pod.yml
2 | apiVersion: v1
3 | kind: Pod
4 | metadata:
5 | name: wiremock-net
6 | spec:
7 | containers:
8 | - name: wiremock-net
9 | image: sheyenrath/wiremock.net
--------------------------------------------------------------------------------
/Kubernetes Examples/kubernetes-rs.yml:
--------------------------------------------------------------------------------
1 | # kubectl create -f kubernetes-rs.yml
2 | apiVersion: apps/v1
3 | kind: ReplicaSet
4 | metadata:
5 | name: wiremock-net-rs
6 | labels:
7 | app: wiremock
8 | tier: frontend
9 | spec:
10 | replicas: 2
11 | selector:
12 | matchLabels:
13 | tier: frontend
14 | template:
15 | metadata:
16 | name: wiremock-net
17 | labels:
18 | tier: frontend
19 | spec:
20 | containers:
21 | - name: wiremock-net
22 | image: sheyenrath/wiremock.net
--------------------------------------------------------------------------------
/Kubernetes Examples/kubernetes.yml:
--------------------------------------------------------------------------------
1 | apiVersion: apps/v1
2 | kind: Deployment
3 | metadata:
4 | name: wiremock-net
5 | spec:
6 | replicas: 1
7 | template:
8 | metadata:
9 | labels:
10 | app: wiremock-net
11 | spec:
12 | containers:
13 | - name: wiremock-net
14 | image: index.docker.io/sheyenrath/wiremock.net:1.8.5
15 | env:
16 | - name: WIREMOCK_NET_VAR1
17 | value: "Value 1"
18 | ports:
19 | - containerPort: 80
20 | ---
21 | apiVersion: v1
22 | kind: Service
23 | metadata:
24 | name: wiremock-net
25 | spec:
26 | type: LoadBalancer
27 | ports:
28 | - port: 80
29 | selector:
30 | app: wiremock-net
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2017 WireMock.Net
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/OLD.nuget.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # WireMock.Net-docker
2 | WireMock.Net-docker is a Docker image which runs [WireMock.Net](https://github.com/wiremock/WireMock.Net) (a flexible library for stubbing and mocking web HTTP responses using request-matching criteria.)
3 |
4 | [](https://slack.wiremock.org/)
5 | [](https://gitter.im/wiremock_dotnet/Lobby)
6 |
7 | ## Linux
8 |
9 | ### Pull latest image
10 |
11 | ```sh
12 | docker pull sheyenrath/wiremock.net
13 | ```
14 |
15 | ### Pull latest image (alpine)
16 |
17 | ```sh
18 | docker pull sheyenrath/wiremock.net-alpine
19 | ```
20 |
21 | ### Start the WireMock.Net container
22 |
23 | ```sh
24 | docker run -it --rm -p 9091:80 sheyenrath/wiremock.net
25 | ```
26 |
27 | ## Windows NanoServer
28 |
29 | The following versions are supported:
30 | - nanoserver-1809
31 | - nanoserver-1903
32 | - nanoserver-1909
33 |
34 | ### Pull latest image
35 |
36 | ```sh
37 | docker pull sheyenrath/wiremock.net-nanoserver-
38 | ```
39 |
40 | ### Start the WireMock.Net container
41 |
42 | ```sh
43 | docker run -it --rm -p 9091:80 sheyenrath/wiremock.net-nanoserver-
44 | ```
45 |
46 | ## Windows 2019
47 |
48 | ### Pull latest image
49 |
50 | ```sh
51 | docker pull sheyenrath/wiremock.net-windows-2019
52 | ```
53 |
54 | ### Start the WireMock.Net container
55 |
56 | ```sh
57 | docker run -it --rm -p 9091:80 sheyenrath/wiremock.net-windows-2019
58 | ```
59 |
60 | ## Windows 2022
61 |
62 | ### Pull latest image
63 |
64 | ```sh
65 | docker pull sheyenrath/wiremock.net-windows
66 | ```
67 |
68 | ### Start the WireMock.Net container
69 |
70 | ```sh
71 | docker run -it --rm -p 9091:80 sheyenrath/wiremock.net-windows
72 | ```
73 |
74 | ## Commands
75 | For all possible commands, see this [WIKI - Commandline Arguments](https://github.com/wiremock/WireMock.Net-docker/wiki/Commandline-arguments)
76 |
77 | ## Using
78 |
79 | > Access [http://localhost:9091/__admin/settings](http://localhost:9091/__admin/mappings) to display the mappings.
80 |
81 | For more functionality, see [WIKI](https://github.com/wiremock/WireMock.Net/wiki)
82 |
--------------------------------------------------------------------------------
/ReleaseNotes.md:
--------------------------------------------------------------------------------
1 | # 1.8.5 (15 May 2025)
2 | - [#54](https://github.com/wiremock/WireMock.Net-docker/pull/54) - Use .NET 8.0 base image [feature] contributed by [StefH](https://github.com/StefH)
3 | - [#31](https://github.com/wiremock/WireMock.Net-docker/issues/31) - How do I consume it? [question]
4 | - [#46](https://github.com/wiremock/WireMock.Net-docker/issues/46) - Arm64 docker images are broken [bug]
5 | - [#49](https://github.com/wiremock/WireMock.Net-docker/issues/49) - Document how to enable request and response logs [question]
6 | - [#52](https://github.com/wiremock/WireMock.Net-docker/issues/52) - Extended support for .NET 6 (LTS) ends on 12 November 2024 [feature]
7 | - [#53](https://github.com/wiremock/WireMock.Net-docker/issues/53) - .NET 8 version? [question]
8 | - [#56](https://github.com/wiremock/WireMock.Net-docker/issues/56) - CVE-2025-24070 - High [bug]
9 |
10 | # 1.6.7 (17 October 2024)
11 | - [#48](https://github.com/wiremock/WireMock.Net-docker/pull/48) - Resolve CVE-2023-5363 and CVE-2023-5678 in alpine image [bug] contributed by [dmytro-pryvedeniuk](https://github.com/dmytro-pryvedeniuk)
12 | - [#51](https://github.com/wiremock/WireMock.Net-docker/issues/51) - WireMock.Net Handlebars helper `Random` Fails in WireMock.Net.Testcontainers 1.6.6 [bug]
13 |
14 | # 1.5.35 (18 October 2023)
15 | - [#39](https://github.com/wiremock/WireMock.Net-docker/pull/39) - Add demands to build pool [feature] contributed by [StefH](https://github.com/StefH)
16 | - [#43](https://github.com/wiremock/WireMock.Net-docker/pull/43) - Switch to alpine image to fix vulnerabilities [feature] contributed by [dmytro-pryvedeniuk](https://github.com/dmytro-pryvedeniuk)
17 | - [#47](https://github.com/wiremock/WireMock.Net-docker/pull/47) - Update alpine Docker image to fix CVE-2022-48174 and CVE-2023-36799 contributed by [dmytro-pryvedeniuk](https://github.com/dmytro-pryvedeniuk)
18 | - [#36](https://github.com/wiremock/WireMock.Net-docker/issues/36) - Persist mappings? [doc]
19 | - [#40](https://github.com/wiremock/WireMock.Net-docker/issues/40) - WatchStaticMappings not working in docker image wiremock.net
20 | - [#42](https://github.com/wiremock/WireMock.Net-docker/issues/42) - Trivy reports about vulnerabilities in the image
21 | - [#44](https://github.com/wiremock/WireMock.Net-docker/issues/44) - Document where to mount request stubs.
22 | - [#45](https://github.com/wiremock/WireMock.Net-docker/issues/45) - Latest version of docker image is broken [bug]
23 |
24 | # 1.5.13 (24 December 2022)
25 | - [#33](https://github.com/wiremock/WireMock.Net-docker/pull/33) - Fixed images for nanoserver and updated images for windows-2019 contributed by [StefH](https://github.com/StefH)
26 | - [#38](https://github.com/wiremock/WireMock.Net-docker/pull/38) - Add ARM (32 & 64) [feature] contributed by [StefH](https://github.com/StefH)
27 | - [#32](https://github.com/wiremock/WireMock.Net-docker/issues/32) - Wrong Nanoserver Base Image [bug]
28 |
29 | # 1.4.3 (06 February 2021)
30 | - [#28](https://github.com/wiremock/WireMock.Net-docker/pull/28) - Use DockerRegistry service connection in Azure Pipeline [feature] contributed by [StefH](https://github.com/StefH)
31 | - [#29](https://github.com/wiremock/WireMock.Net-docker/pull/29) - update Dockerfile with dotnet 5.0 contributed by [ibmer921150](https://github.com/ibmer921150)
32 | - [#30](https://github.com/wiremock/WireMock.Net-docker/issues/30) - WireMock Setting 'SaveMappingToFile' raising cast object to type error [bug]
33 |
34 | # 1.3.7 (17 November 2020)
35 | - [#24](https://github.com/wiremock/WireMock.Net-docker/pull/24) - Add docker-compose example contributed by [StefH](https://github.com/StefH)
36 | - [#25](https://github.com/wiremock/WireMock.Net-docker/pull/25) - Use NetCore 3.1 (sdk:3.1 & runtime-deps:3.1-bionic) contributed by [StefH](https://github.com/StefH)
37 | - [#27](https://github.com/wiremock/WireMock.Net-docker/pull/27) - Pool contributed by [StefH](https://github.com/StefH)
38 | - [#10](https://github.com/wiremock/WireMock.Net-docker/issues/10) - Persisting the recorded mappings [documentation]
39 | - [#23](https://github.com/wiremock/WireMock.Net-docker/issues/23) - Dockerized wiremock.net does not read static mappings [documentation]
40 |
41 | # 1.1.10 (05 March 2020)
42 |
43 | # 1.1.2.0 (09 January 2020)
44 |
45 | # 1.1.1.0 (09 January 2020)
46 | - [#22](https://github.com/wiremock/WireMock.Net-docker/pull/22) - Removed ReadStaticMappings, moved WireMockLogger as CMD argument [feature] contributed by [kashifsoofi](https://github.com/kashifsoofi)
47 | - [#21](https://github.com/wiremock/WireMock.Net-docker/issues/21) - CMD parameters vs ENTRYPOINT parameters
48 |
49 | # 1.0.22.0 (15 July 2019)
50 |
51 | # 1.0.21.0 (06 July 2019)
52 | - [#20](https://github.com/wiremock/WireMock.Net-docker/pull/20) - 1.0.19 [feature] contributed by [StefH](https://github.com/StefH)
53 |
54 | # 1.0.18.0 (10 June 2019)
55 | - [#18](https://github.com/wiremock/WireMock.Net-docker/pull/18) - Add docker image 'windows 2019' [feature] contributed by [StefH](https://github.com/StefH)
56 | - [#19](https://github.com/wiremock/WireMock.Net-docker/pull/19) - --WireMockLogger (version 1.0.18) [feature] contributed by [StefH](https://github.com/StefH)
57 |
58 | # 1.0.16.0 (05 June 2019)
59 |
60 | # 1.0.15.0 (04 May 2019)
61 |
62 | # 1.0.13.0 (15 April 2019)
63 | - [#16](https://github.com/wiremock/WireMock.Net-docker/pull/16) - 1.0.13 [feature] contributed by [StefH](https://github.com/StefH)
64 |
65 | # 1.0.12.0 (05 April 2019)
66 |
67 | # 1.0.11.0 (30 March 2019)
68 |
69 | # 1.0.10.0 (27 March 2019)
70 | - [#15](https://github.com/wiremock/WireMock.Net-docker/pull/15) - 1.0.10 [feature] contributed by [StefH](https://github.com/StefH)
71 |
72 | # 1.0.9.0 (25 March 2019)
73 | - [#14](https://github.com/wiremock/WireMock.Net-docker/pull/14) - 1.0.9 [feature] contributed by [StefH](https://github.com/StefH)
74 |
75 | # 1.0.8.0 (12 March 2019)
76 |
77 | # 1.0.7.0 (20 January 2019)
78 | - [#12](https://github.com/wiremock/WireMock.Net-docker/pull/12) - Docker version 1.0.7 [feature] contributed by [StefH](https://github.com/StefH)
79 | - [#13](https://github.com/wiremock/WireMock.Net-docker/pull/13) - NanoServer 1803 [feature] contributed by [StefH](https://github.com/StefH)
80 | - [#11](https://github.com/wiremock/WireMock.Net-docker/issues/11) - Create Nano-1803 image
81 |
82 | # 1.0.6.1 (12 January 2019)
83 | - [#7](https://github.com/wiremock/WireMock.Net-docker/pull/7) - Set up CI with Azure Pipelines contributed by [azure-pipelines[bot]](https://github.com/apps/azure-pipelines)
84 | - [#2](https://github.com/wiremock/WireMock.Net-docker/issues/2) - Feature: Add azure-pipelines to build docker image [feature]
85 | - [#8](https://github.com/wiremock/WireMock.Net-docker/issues/8) - Dockerized WireMock.Net does not honor mapping after posting to server [question]
86 |
87 | # 1.0.6 (15 December 2018)
88 | - [#9](https://github.com/wiremock/WireMock.Net-docker/pull/9) - 1.0.6 contributed by [StefH](https://github.com/StefH)
89 |
90 | # 1.0.5 (07 December 2018)
91 |
92 | # 1.0.4.20 (07 November 2018)
93 |
94 | # 1.0.4.19 (31 October 2018)
95 | - [#6](https://github.com/wiremock/WireMock.Net-docker/pull/6) - 1.0.4.19 contributed by [StefH](https://github.com/StefH)
96 |
97 | # 1.0.4.18 (30 October 2018)
98 | - [#5](https://github.com/wiremock/WireMock.Net-docker/pull/5) - NetCoreApp 2.1 and 1.0.4.18 contributed by [StefH](https://github.com/StefH)
99 | - [#3](https://github.com/wiremock/WireMock.Net-docker/issues/3) - Change: Disable partial match by default for StandAlone application.
100 | - [#4](https://github.com/wiremock/WireMock.Net-docker/issues/4) - Bug: Add "latest" table to docker image
101 |
102 | # 1.0.4.13 (01 September 2018)
103 |
104 | # 1.0.4.5 (17 July 2018)
105 | - [#1](https://github.com/wiremock/WireMock.Net-docker/issues/1) - Image update
106 |
107 |
--------------------------------------------------------------------------------
/StandAlone.NETCoreApp.Local/.dockerignore:
--------------------------------------------------------------------------------
1 | bin/
2 | obj/
3 |
--------------------------------------------------------------------------------
/StandAlone.NETCoreApp.Local/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env
2 |
3 | LABEL maintainer="Stef Heyenrath"
4 |
5 | WORKDIR /app
6 |
7 | # copy csproj and restore as distinct layers
8 | COPY StandAlone.NETCoreApp.csproj ./
9 | RUN dotnet restore
10 |
11 | # copy everything else and build
12 | COPY *.cs ./
13 | RUN dotnet publish -c Release -r linux-x64 -o out
14 |
15 | # build runtime image
16 | FROM mcr.microsoft.com/dotnet/aspnet:8.0
17 | ENV ASPNETCORE_HTTP_PORTS=80
18 | WORKDIR /app
19 | COPY --from=build-env /app/out ./
20 | EXPOSE 80
21 | ENTRYPOINT ["./wiremock-net", "--Urls", "http://*:80"]
22 | CMD ["--WireMockLogger", "WireMockConsoleLogger"]
23 |
24 | # Just some info:
25 | # build with : docker build -t sheyenrath/wiremock.net .
26 | # run with : docker run --rm -p 9091:80 sheyenrath/wiremock.net
27 |
--------------------------------------------------------------------------------
/StandAlone.NETCoreApp.Local/Dockerfile.alpine:
--------------------------------------------------------------------------------
1 | FROM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS build-env
2 |
3 | LABEL maintainer="Stef Heyenrath"
4 |
5 | WORKDIR /app
6 |
7 | # Copy the NuGetForDocker folder with the nupkg files and the nuget.config file to the container
8 | COPY ./nuget.config.Docker ./nuget.config
9 | COPY ./NuGetForDocker/*.nupkg ./NuGetForDocker/
10 |
11 | # copy csproj and restore as distinct layers
12 | COPY StandAlone.NETCoreApp.Local.csproj ./
13 | RUN dotnet restore
14 |
15 | # copy everything else and build
16 | COPY *.cs ./
17 | RUN dotnet publish -c Release -o out
18 |
19 | # build runtime image
20 | FROM mcr.microsoft.com/dotnet/aspnet:8.0-alpine
21 | ENV ASPNETCORE_HTTP_PORTS=80
22 |
23 | WORKDIR /app
24 | COPY --from=build-env /app/out ./
25 | EXPOSE 80
26 | ENTRYPOINT ["./wiremock-net", "--Urls", "http://*:80"]
27 | CMD ["--WireMockLogger", "WireMockConsoleLogger"]
28 |
29 | # Just some info:
30 | # build with : docker build -t sheyenrath/wiremock.net-alpine -f Dockerfile.alpine .
31 | # run with : docker run --rm -p 9091:80 sheyenrath/wiremock.net-alpine
32 |
--------------------------------------------------------------------------------
/StandAlone.NETCoreApp.Local/Dockerfile.arm-32:
--------------------------------------------------------------------------------
1 | FROM mcr.microsoft.com/dotnet/sdk:8.0-bookworm-slim-arm32v7 AS build-env
2 |
3 | LABEL maintainer="Stef Heyenrath"
4 |
5 | WORKDIR /app
6 |
7 | # copy csproj and restore as distinct layers
8 | COPY StandAlone.NETCoreApp.csproj ./
9 | RUN dotnet restore
10 |
11 | # copy everything else and build
12 | COPY *.cs ./
13 | RUN dotnet publish -c Release -r linux-arm --no-self-contained -o out
14 |
15 | # build runtime image
16 | FROM mcr.microsoft.com/dotnet/aspnet:8.0
17 | ENV ASPNETCORE_HTTP_PORTS=80
18 |
19 | WORKDIR /app
20 | COPY --from=build-env /app/out ./
21 | EXPOSE 80
22 | ENTRYPOINT ["./wiremock-net", "--Urls", "http://*:80"]
23 | CMD ["--WireMockLogger", "WireMockConsoleLogger"]
24 |
25 | # Just some info:
26 | # build with : docker build -t sheyenrath/wiremock.net .
27 | # run with : docker run --rm -p 9091:80 sheyenrath/wiremock.net
28 |
--------------------------------------------------------------------------------
/StandAlone.NETCoreApp.Local/Dockerfile.arm-64:
--------------------------------------------------------------------------------
1 | FROM mcr.microsoft.com/dotnet/sdk:8.0.404-bookworm-slim-arm64v8 AS build-env
2 |
3 | LABEL maintainer="Stef Heyenrath"
4 |
5 | WORKDIR /app
6 |
7 | # copy csproj and restore as distinct layers
8 | COPY StandAlone.NETCoreApp.csproj ./
9 | RUN dotnet restore
10 |
11 | # copy everything else and build
12 | COPY *.cs ./
13 | RUN dotnet publish -c Release -r linux-arm64 --no-self-contained -o out
14 |
15 | # build runtime image
16 | FROM mcr.microsoft.com/dotnet/aspnet:8.0
17 | WORKDIR /app
18 | COPY --from=build-env /app/out ./
19 | EXPOSE 80
20 | ENTRYPOINT ["./wiremock-net", "--Urls", "http://*:80"]
21 | CMD ["--WireMockLogger", "WireMockConsoleLogger"]
22 |
23 | # Just some info:
24 | # build with : docker build -t sheyenrath/wiremock.net .
25 | # run with : docker run --rm -p 9091:80 sheyenrath/wiremock.net
26 |
--------------------------------------------------------------------------------
/StandAlone.NETCoreApp.Local/Dockerfile.nanoserver-1809:
--------------------------------------------------------------------------------
1 | FROM mcr.microsoft.com/dotnet/sdk:8.0.404-nanoserver-1809 AS build-env
2 |
3 | LABEL maintainer="Stef Heyenrath"
4 |
5 | WORKDIR /app
6 |
7 | # copy csproj and restore as distinct layers
8 | COPY StandAlone.NETCoreApp.csproj ./
9 | RUN dotnet restore
10 |
11 | # copy everything else and build
12 | COPY *.cs ./
13 | RUN dotnet publish -c Release -o out
14 |
15 | # build runtime image
16 | FROM mcr.microsoft.com/dotnet/sdk:8.0-nanoserver-1809
17 | ENV ASPNETCORE_HTTP_PORTS=80
18 | WORKDIR /app
19 | COPY --from=build-env /app/out ./
20 | EXPOSE 80
21 | ENTRYPOINT ["dotnet", "wiremock-net.dll", "--Urls", "http://*:80", "--WireMockLogger", "WireMockConsoleLogger"]
22 |
23 | # Just some info to build and run:
24 | # build with : docker build -t sheyenrath/wiremock.net-nanoserver-1809 -f Dockerfile.nanoserver-1809 .
25 | # run with : docker run --rm -i -p 9090:80 sheyenrath/wiremock.net-nanoserver-1809 --AdminUsername a --AdminPassword b
--------------------------------------------------------------------------------
/StandAlone.NETCoreApp.Local/Dockerfile.nanoserver-1903:
--------------------------------------------------------------------------------
1 | FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build-env
2 |
3 | LABEL maintainer="Stef Heyenrath"
4 |
5 | WORKDIR /app
6 |
7 | # copy csproj and restore as distinct layers
8 | COPY StandAlone.NETCoreApp.csproj ./
9 | RUN dotnet restore
10 |
11 | # copy everything else and build
12 | COPY *.cs ./
13 | RUN dotnet publish -c Release -o out
14 |
15 | # build runtime image
16 | FROM mcr.microsoft.com/dotnet/core/sdk:3.1-nanoserver-1903
17 | WORKDIR /app
18 | COPY --from=build-env /app/out ./
19 | EXPOSE 80
20 | ENTRYPOINT ["dotnet", "wiremock-net.dll", "--Urls", "http://*:80"]
21 | CMD ["--WireMockLogger", "WireMockConsoleLogger"]
22 |
23 | # Just some info to build and run:
24 | # build with : docker build -t sheyenrath/wiremock.net-nanoserver-1903 -f Dockerfile.nanoserver-1903 .
25 | # run with : docker run --rm -i -p 9090:80 sheyenrath/wiremock.net-nanoserver-1903 --AdminUsername a --AdminPassword b
--------------------------------------------------------------------------------
/StandAlone.NETCoreApp.Local/Dockerfile.nanoserver-1909:
--------------------------------------------------------------------------------
1 | FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build-env
2 |
3 | LABEL maintainer="Stef Heyenrath"
4 |
5 | WORKDIR /app
6 |
7 | # copy csproj and restore as distinct layers
8 | COPY StandAlone.NETCoreApp.csproj ./
9 | RUN dotnet restore
10 |
11 | # copy everything else and build
12 | COPY *.cs ./
13 | RUN dotnet publish -c Release -o out
14 |
15 | # build runtime image
16 | FROM mcr.microsoft.com/dotnet/core/sdk:3.1-nanoserver-1909
17 | WORKDIR /app
18 | COPY --from=build-env /app/out ./
19 | EXPOSE 80
20 | ENTRYPOINT ["dotnet", "wiremock-net.dll", "--Urls", "http://*:80"]
21 | CMD ["--WireMockLogger", "WireMockConsoleLogger"]
22 |
23 | # Just some info to build and run:
24 | # build with : docker build -t sheyenrath/wiremock.net-nanoserver-1909 -f Dockerfile.nanoserver-1909 .
25 | # run with : docker run --rm -i -p 9090:80 sheyenrath/wiremock.net-nanoserver-1909 --AdminUsername a --AdminPassword b
--------------------------------------------------------------------------------
/StandAlone.NETCoreApp.Local/Dockerfile.nanoserver-2022:
--------------------------------------------------------------------------------
1 | FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build-env
2 |
3 | LABEL maintainer="Stef Heyenrath"
4 |
5 | WORKDIR /app
6 |
7 | # copy csproj and restore as distinct layers
8 | COPY StandAlone.NETCoreApp.csproj ./
9 | RUN dotnet restore
10 |
11 | # copy everything else and build
12 | COPY *.cs ./
13 | RUN dotnet publish -c Release -o out
14 |
15 | # build runtime image
16 | FROM mcr.microsoft.com/dotnet/aspnet:6.0
17 | WORKDIR /app
18 | COPY --from=build-env /app/out ./
19 | EXPOSE 80
20 | ENTRYPOINT ["dotnet", "wiremock-net.dll", "--Urls", "http://*:80"]
21 | CMD ["--WireMockLogger", "WireMockConsoleLogger"]
22 |
23 | # Just some info to build and run:
24 | # build with : docker build -t sheyenrath/wiremock.net-nanoserver-2022 -f Dockerfile.nanoserver-2022 .
25 | # run with : docker run --rm -i -p 9090:80 sheyenrath/wiremock.net-nanoserver-2022 --AdminUsername a --AdminPassword b
--------------------------------------------------------------------------------
/StandAlone.NETCoreApp.Local/Dockerfile.windows:
--------------------------------------------------------------------------------
1 | FROM mcr.microsoft.com/dotnet/sdk:8.0-windowsservercore-ltsc2022 AS build-env
2 |
3 | LABEL maintainer="Stef Heyenrath"
4 |
5 | WORKDIR /app
6 |
7 | # copy csproj and restore as distinct layers
8 | COPY StandAlone.NETCoreApp.csproj ./
9 | RUN dotnet restore
10 |
11 | # copy everything else and build
12 | COPY *.cs ./
13 | RUN dotnet publish -c Release -o out
14 |
15 | # build runtime image
16 | FROM mcr.microsoft.com/dotnet/aspnet:8.0-windowsservercore-ltsc2022
17 | ENV ASPNETCORE_HTTP_PORTS=80
18 | WORKDIR /app
19 | COPY --from=build-env /app/out ./
20 | EXPOSE 80
21 | ENTRYPOINT ["dotnet", "wiremock-net.dll", "--Urls", "http://*:80", "--WireMockLogger", "WireMockConsoleLogger"]
22 |
23 | # Just some info to build and run:
24 | # build with : docker build -t sheyenrath/wiremock.net-windows -f Dockerfile.windows .
25 | # run with : docker run --rm -i -p 9090:80 sheyenrath/wiremock.net-windows --AdminUsername a --AdminPassword b
--------------------------------------------------------------------------------
/StandAlone.NETCoreApp.Local/Dockerfile.windows-2019:
--------------------------------------------------------------------------------
1 | FROM mcr.microsoft.com/dotnet/sdk:8.0-windowsservercore-ltsc2019 AS build-env
2 |
3 | LABEL maintainer="Stef Heyenrath"
4 |
5 | WORKDIR /app
6 |
7 | # copy csproj and restore as distinct layers
8 | COPY StandAlone.NETCoreApp.csproj ./
9 | RUN dotnet restore
10 |
11 | # copy everything else and build
12 | COPY *.cs ./
13 | RUN dotnet publish -c Release -o out
14 |
15 | # build runtime image
16 | FROM mcr.microsoft.com/dotnet/aspnet:8.0-windowsservercore-ltsc2019
17 | ENV ASPNETCORE_HTTP_PORTS=80
18 | WORKDIR /app
19 | COPY --from=build-env /app/out ./
20 | EXPOSE 80
21 | ENTRYPOINT ["dotnet", "wiremock-net.dll", "--Urls", "http://*:80", "--WireMockLogger", "WireMockConsoleLogger"]
22 |
23 | # Just some info to build and run:
24 | # build with : docker build -t sheyenrath/wiremock.net-windows-2019 -f Dockerfile.windows-2019 .
25 | # run with : docker run --rm -i -p 9090:80 sheyenrath/wiremock.net-windows-2019 --AdminUsername a --AdminPassword b
--------------------------------------------------------------------------------
/StandAlone.NETCoreApp.Local/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading;
3 | using WireMock.Server;
4 | using WireMock.Settings;
5 |
6 | namespace StandAlone.NETCoreApp;
7 |
8 | class Program
9 | {
10 | private const int SleepTime = 30000;
11 |
12 | private static WireMockServer _server;
13 |
14 | static void Main(string[] args)
15 | {
16 | if (!WireMockServerSettingsParser.TryParseArguments(args, Environment.GetEnvironmentVariables(), out var settings))
17 | {
18 | Console.Error.WriteLine("Commandline arguments are invalid. WireMock.Net cannot start.");
19 | Environment.Exit(0);
20 | }
21 |
22 | _server = WireMockServer.Start(settings);
23 |
24 | Console.Out.WriteLine($"{DateTime.UtcNow} Press Ctrl+C to shut down");
25 |
26 | Console.CancelKeyPress += (s, e) =>
27 | {
28 | Stop("CancelKeyPress");
29 | };
30 |
31 | System.Runtime.Loader.AssemblyLoadContext.Default.Unloading += ctx =>
32 | {
33 | Stop("AssemblyLoadContext.Default.Unloading");
34 | };
35 |
36 | while (true)
37 | {
38 | Console.Out.WriteLine($"{DateTime.UtcNow} WireMock.Net server running");
39 | Thread.Sleep(SleepTime);
40 | }
41 | }
42 |
43 | private static void Stop(string why)
44 | {
45 | Console.Out.WriteLine($"{DateTime.UtcNow} WireMock.Net server stopping because '{why}'");
46 | _server.Stop();
47 | Console.Out.WriteLine($"{DateTime.UtcNow} WireMock.Net server stopped");
48 | }
49 | }
--------------------------------------------------------------------------------
/StandAlone.NETCoreApp.Local/StandAlone.NETCoreApp.Local.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | Exe
4 | net8.0
5 | wiremock-net
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/StandAlone.NETCoreApp.Local/WireMock.Net-Logo.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wiremock/WireMock.Net-docker/b75902ecf0c7d5dbae0f4831178a2f80bf6944e1/StandAlone.NETCoreApp.Local/WireMock.Net-Logo.ico
--------------------------------------------------------------------------------
/StandAlone.NETCoreApp.Local/create.alpine.ps1:
--------------------------------------------------------------------------------
1 | dotnet restore
2 |
3 | # Copy all *.nupkg files from all directories ending with /Release
4 | $sourcePath = "C:\dev\GitHub\WireMock.Net\src"
5 | $destinationPath = ".\NuGetForDocker"
6 | Get-ChildItem -Path $sourcePath -Recurse -Filter *.nupkg | Where-Object { $_.FullName -like "*\Release\*" } | Copy-Item -Destination $destinationPath -Force
7 |
8 | docker build -t sheyenrath/wiremock.net-alpine -f .\Dockerfile.alpine .
9 | docker rmi $(docker images -f "dangling=true" -q)
10 | docker images
--------------------------------------------------------------------------------
/StandAlone.NETCoreApp.Local/nuget.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/StandAlone.NETCoreApp.Local/nuget.config.Docker:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/StandAlone.NETCoreApp/.dockerignore:
--------------------------------------------------------------------------------
1 | bin/
2 | obj/
3 |
--------------------------------------------------------------------------------
/StandAlone.NETCoreApp/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env
2 |
3 | LABEL maintainer="Stef Heyenrath"
4 |
5 | WORKDIR /app
6 |
7 | # copy csproj and restore as distinct layers
8 | COPY StandAlone.NETCoreApp.csproj ./
9 | RUN dotnet restore
10 |
11 | # copy everything else and build
12 | COPY *.cs ./
13 | RUN dotnet publish -c Release -r linux-x64 -o out
14 |
15 | # build runtime image
16 | FROM mcr.microsoft.com/dotnet/aspnet:8.0
17 | ENV ASPNETCORE_HTTP_PORTS=80
18 | WORKDIR /app
19 | COPY --from=build-env /app/out ./
20 | EXPOSE 80
21 | ENTRYPOINT ["./wiremock-net", "--Urls", "http://*:80"]
22 | CMD ["--WireMockLogger", "WireMockConsoleLogger"]
23 |
24 | # Just some info:
25 | # build with : docker build -t sheyenrath/wiremock.net .
26 | # run with : docker run --rm -p 9091:80 sheyenrath/wiremock.net
27 |
--------------------------------------------------------------------------------
/StandAlone.NETCoreApp/Dockerfile.alpine:
--------------------------------------------------------------------------------
1 | FROM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS build-env
2 |
3 | LABEL maintainer="Stef Heyenrath"
4 |
5 | WORKDIR /app
6 |
7 | # copy csproj and restore as distinct layers
8 | COPY StandAlone.NETCoreApp.csproj ./
9 | RUN dotnet restore
10 |
11 | # copy everything else and build
12 | COPY *.cs ./
13 | RUN dotnet publish -c Release -o out
14 |
15 | # build runtime image
16 | FROM mcr.microsoft.com/dotnet/aspnet:8.0-alpine
17 | ENV ASPNETCORE_HTTP_PORTS=80
18 |
19 | WORKDIR /app
20 | COPY --from=build-env /app/out ./
21 | EXPOSE 80
22 | ENTRYPOINT ["./wiremock-net", "--Urls", "http://*:80"]
23 | CMD ["--WireMockLogger", "WireMockConsoleLogger"]
24 |
25 | # Just some info:
26 | # build with : docker build -t sheyenrath/wiremock.net-alpine -f Dockerfile.alpine .
27 | # run with : docker run --rm -p 9091:80 sheyenrath/wiremock.net-alpine
28 |
--------------------------------------------------------------------------------
/StandAlone.NETCoreApp/Dockerfile.arm-32:
--------------------------------------------------------------------------------
1 | FROM mcr.microsoft.com/dotnet/sdk:8.0-bookworm-slim-arm32v7 AS build-env
2 |
3 | LABEL maintainer="Stef Heyenrath"
4 |
5 | WORKDIR /app
6 |
7 | # copy csproj and restore as distinct layers
8 | COPY StandAlone.NETCoreApp.csproj ./
9 | RUN dotnet restore
10 |
11 | # copy everything else and build
12 | COPY *.cs ./
13 | RUN dotnet publish -c Release -r linux-arm --no-self-contained -o out
14 |
15 | # build runtime image
16 | FROM mcr.microsoft.com/dotnet/aspnet:8.0
17 | ENV ASPNETCORE_HTTP_PORTS=80
18 |
19 | WORKDIR /app
20 | COPY --from=build-env /app/out ./
21 | EXPOSE 80
22 | ENTRYPOINT ["./wiremock-net", "--Urls", "http://*:80"]
23 | CMD ["--WireMockLogger", "WireMockConsoleLogger"]
24 |
25 | # Just some info:
26 | # build with : docker build -t sheyenrath/wiremock.net .
27 | # run with : docker run --rm -p 9091:80 sheyenrath/wiremock.net
28 |
--------------------------------------------------------------------------------
/StandAlone.NETCoreApp/Dockerfile.arm-64:
--------------------------------------------------------------------------------
1 | FROM mcr.microsoft.com/dotnet/sdk:8.0.404-bookworm-slim-arm64v8 AS build-env
2 |
3 | LABEL maintainer="Stef Heyenrath"
4 |
5 | WORKDIR /app
6 |
7 | # copy csproj and restore as distinct layers
8 | COPY StandAlone.NETCoreApp.csproj ./
9 | RUN dotnet restore
10 |
11 | # copy everything else and build
12 | COPY *.cs ./
13 | RUN dotnet publish -c Release -r linux-arm64 --no-self-contained -o out
14 |
15 | # build runtime image
16 | FROM mcr.microsoft.com/dotnet/aspnet:8.0
17 | WORKDIR /app
18 | COPY --from=build-env /app/out ./
19 | EXPOSE 80
20 | ENTRYPOINT ["./wiremock-net", "--Urls", "http://*:80"]
21 | CMD ["--WireMockLogger", "WireMockConsoleLogger"]
22 |
23 | # Just some info:
24 | # build with : docker build -t sheyenrath/wiremock.net .
25 | # run with : docker run --rm -p 9091:80 sheyenrath/wiremock.net
26 |
--------------------------------------------------------------------------------
/StandAlone.NETCoreApp/Dockerfile.nanoserver-1809:
--------------------------------------------------------------------------------
1 | FROM mcr.microsoft.com/dotnet/sdk:8.0.404-nanoserver-1809 AS build-env
2 |
3 | LABEL maintainer="Stef Heyenrath"
4 |
5 | WORKDIR /app
6 |
7 | # copy csproj and restore as distinct layers
8 | COPY StandAlone.NETCoreApp.csproj ./
9 | RUN dotnet restore
10 |
11 | # copy everything else and build
12 | COPY *.cs ./
13 | RUN dotnet publish -c Release -o out
14 |
15 | # build runtime image
16 | FROM mcr.microsoft.com/dotnet/sdk:8.0-nanoserver-1809
17 | ENV ASPNETCORE_HTTP_PORTS=80
18 | WORKDIR /app
19 | COPY --from=build-env /app/out ./
20 | EXPOSE 80
21 | ENTRYPOINT ["dotnet", "wiremock-net.dll", "--Urls", "http://*:80", "--WireMockLogger", "WireMockConsoleLogger"]
22 |
23 | # Just some info to build and run:
24 | # build with : docker build -t sheyenrath/wiremock.net-nanoserver-1809 -f Dockerfile.nanoserver-1809 .
25 | # run with : docker run --rm -i -p 9090:80 sheyenrath/wiremock.net-nanoserver-1809 --AdminUsername a --AdminPassword b
--------------------------------------------------------------------------------
/StandAlone.NETCoreApp/Dockerfile.nanoserver-1903:
--------------------------------------------------------------------------------
1 | FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build-env
2 |
3 | LABEL maintainer="Stef Heyenrath"
4 |
5 | WORKDIR /app
6 |
7 | # copy csproj and restore as distinct layers
8 | COPY StandAlone.NETCoreApp.csproj ./
9 | RUN dotnet restore
10 |
11 | # copy everything else and build
12 | COPY *.cs ./
13 | RUN dotnet publish -c Release -o out
14 |
15 | # build runtime image
16 | FROM mcr.microsoft.com/dotnet/core/sdk:3.1-nanoserver-1903
17 | WORKDIR /app
18 | COPY --from=build-env /app/out ./
19 | EXPOSE 80
20 | ENTRYPOINT ["dotnet", "wiremock-net.dll", "--Urls", "http://*:80"]
21 | CMD ["--WireMockLogger", "WireMockConsoleLogger"]
22 |
23 | # Just some info to build and run:
24 | # build with : docker build -t sheyenrath/wiremock.net-nanoserver-1903 -f Dockerfile.nanoserver-1903 .
25 | # run with : docker run --rm -i -p 9090:80 sheyenrath/wiremock.net-nanoserver-1903 --AdminUsername a --AdminPassword b
--------------------------------------------------------------------------------
/StandAlone.NETCoreApp/Dockerfile.nanoserver-1909:
--------------------------------------------------------------------------------
1 | FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build-env
2 |
3 | LABEL maintainer="Stef Heyenrath"
4 |
5 | WORKDIR /app
6 |
7 | # copy csproj and restore as distinct layers
8 | COPY StandAlone.NETCoreApp.csproj ./
9 | RUN dotnet restore
10 |
11 | # copy everything else and build
12 | COPY *.cs ./
13 | RUN dotnet publish -c Release -o out
14 |
15 | # build runtime image
16 | FROM mcr.microsoft.com/dotnet/core/sdk:3.1-nanoserver-1909
17 | WORKDIR /app
18 | COPY --from=build-env /app/out ./
19 | EXPOSE 80
20 | ENTRYPOINT ["dotnet", "wiremock-net.dll", "--Urls", "http://*:80"]
21 | CMD ["--WireMockLogger", "WireMockConsoleLogger"]
22 |
23 | # Just some info to build and run:
24 | # build with : docker build -t sheyenrath/wiremock.net-nanoserver-1909 -f Dockerfile.nanoserver-1909 .
25 | # run with : docker run --rm -i -p 9090:80 sheyenrath/wiremock.net-nanoserver-1909 --AdminUsername a --AdminPassword b
--------------------------------------------------------------------------------
/StandAlone.NETCoreApp/Dockerfile.nanoserver-2022:
--------------------------------------------------------------------------------
1 | FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build-env
2 |
3 | LABEL maintainer="Stef Heyenrath"
4 |
5 | WORKDIR /app
6 |
7 | # copy csproj and restore as distinct layers
8 | COPY StandAlone.NETCoreApp.csproj ./
9 | RUN dotnet restore
10 |
11 | # copy everything else and build
12 | COPY *.cs ./
13 | RUN dotnet publish -c Release -o out
14 |
15 | # build runtime image
16 | FROM mcr.microsoft.com/dotnet/aspnet:6.0
17 | WORKDIR /app
18 | COPY --from=build-env /app/out ./
19 | EXPOSE 80
20 | ENTRYPOINT ["dotnet", "wiremock-net.dll", "--Urls", "http://*:80"]
21 | CMD ["--WireMockLogger", "WireMockConsoleLogger"]
22 |
23 | # Just some info to build and run:
24 | # build with : docker build -t sheyenrath/wiremock.net-nanoserver-2022 -f Dockerfile.nanoserver-2022 .
25 | # run with : docker run --rm -i -p 9090:80 sheyenrath/wiremock.net-nanoserver-2022 --AdminUsername a --AdminPassword b
--------------------------------------------------------------------------------
/StandAlone.NETCoreApp/Dockerfile.windows:
--------------------------------------------------------------------------------
1 | FROM mcr.microsoft.com/dotnet/sdk:8.0-windowsservercore-ltsc2022 AS build-env
2 |
3 | LABEL maintainer="Stef Heyenrath"
4 |
5 | WORKDIR /app
6 |
7 | # copy csproj and restore as distinct layers
8 | COPY StandAlone.NETCoreApp.csproj ./
9 | RUN dotnet restore
10 |
11 | # copy everything else and build
12 | COPY *.cs ./
13 | RUN dotnet publish -c Release -o out
14 |
15 | # build runtime image
16 | FROM mcr.microsoft.com/dotnet/aspnet:8.0-windowsservercore-ltsc2022
17 | ENV ASPNETCORE_HTTP_PORTS=80
18 | WORKDIR /app
19 | COPY --from=build-env /app/out ./
20 | EXPOSE 80
21 | ENTRYPOINT ["dotnet", "wiremock-net.dll", "--Urls", "http://*:80", "--WireMockLogger", "WireMockConsoleLogger"]
22 |
23 | # Just some info to build and run:
24 | # build with : docker build -t sheyenrath/wiremock.net-windows -f Dockerfile.windows .
25 | # run with : docker run --rm -i -p 9090:80 sheyenrath/wiremock.net-windows --AdminUsername a --AdminPassword b
--------------------------------------------------------------------------------
/StandAlone.NETCoreApp/Dockerfile.windows-2019:
--------------------------------------------------------------------------------
1 | FROM mcr.microsoft.com/dotnet/sdk:8.0-windowsservercore-ltsc2019 AS build-env
2 |
3 | LABEL maintainer="Stef Heyenrath"
4 |
5 | WORKDIR /app
6 |
7 | # copy csproj and restore as distinct layers
8 | COPY StandAlone.NETCoreApp.csproj ./
9 | RUN dotnet restore
10 |
11 | # copy everything else and build
12 | COPY *.cs ./
13 | RUN dotnet publish -c Release -o out
14 |
15 | # build runtime image
16 | FROM mcr.microsoft.com/dotnet/aspnet:8.0-windowsservercore-ltsc2019
17 | ENV ASPNETCORE_HTTP_PORTS=80
18 | WORKDIR /app
19 | COPY --from=build-env /app/out ./
20 | EXPOSE 80
21 | ENTRYPOINT ["dotnet", "wiremock-net.dll", "--Urls", "http://*:80", "--WireMockLogger", "WireMockConsoleLogger"]
22 |
23 | # Just some info to build and run:
24 | # build with : docker build -t sheyenrath/wiremock.net-windows-2019 -f Dockerfile.windows-2019 .
25 | # run with : docker run --rm -i -p 9090:80 sheyenrath/wiremock.net-windows-2019 --AdminUsername a --AdminPassword b
--------------------------------------------------------------------------------
/StandAlone.NETCoreApp/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading;
3 | using WireMock.Server;
4 | using WireMock.Settings;
5 |
6 | namespace StandAlone.NETCoreApp;
7 |
8 | class Program
9 | {
10 | private const int SleepTime = 30000;
11 |
12 | private static WireMockServer _server;
13 |
14 | static void Main(string[] args)
15 | {
16 | if (!WireMockServerSettingsParser.TryParseArguments(args, Environment.GetEnvironmentVariables(), out var settings))
17 | {
18 | Console.Error.WriteLine("Commandline arguments are invalid. WireMock.Net cannot start.");
19 | Environment.Exit(0);
20 | }
21 |
22 | _server = WireMockServer.Start(settings);
23 |
24 | Console.Out.WriteLine($"{DateTime.UtcNow} Press Ctrl+C to shut down");
25 |
26 | Console.CancelKeyPress += (s, e) =>
27 | {
28 | Stop("CancelKeyPress");
29 | };
30 |
31 | System.Runtime.Loader.AssemblyLoadContext.Default.Unloading += ctx =>
32 | {
33 | Stop("AssemblyLoadContext.Default.Unloading");
34 | };
35 |
36 | while (true)
37 | {
38 | Console.Out.WriteLine($"{DateTime.UtcNow} WireMock.Net server running");
39 | Thread.Sleep(SleepTime);
40 | }
41 | }
42 |
43 | private static void Stop(string why)
44 | {
45 | Console.Out.WriteLine($"{DateTime.UtcNow} WireMock.Net server stopping because '{why}'");
46 | _server.Stop();
47 | Console.Out.WriteLine($"{DateTime.UtcNow} WireMock.Net server stopped");
48 | }
49 | }
--------------------------------------------------------------------------------
/StandAlone.NETCoreApp/StandAlone.NETCoreApp.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | Exe
4 | net8.0
5 | wiremock-net
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/StandAlone.NETCoreApp/WireMock.Net-Logo.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wiremock/WireMock.Net-docker/b75902ecf0c7d5dbae0f4831178a2f80bf6944e1/StandAlone.NETCoreApp/WireMock.Net-Logo.ico
--------------------------------------------------------------------------------
/StandAlone.NETCoreApp/create.alpine.ps1:
--------------------------------------------------------------------------------
1 | docker build -t sheyenrath/wiremock.net-alpine -f .\Dockerfile.alpine .
2 | docker rmi $(docker images -f "dangling=true" -q)
3 | docker images
--------------------------------------------------------------------------------
/StandAlone.NETCoreApp/create.nanoserver-1809.ps1:
--------------------------------------------------------------------------------
1 | docker build -t sheyenrath/wiremock.net-nanoserver-1809 -f .\Dockerfile.nanoserver-1809 .
2 | docker rmi $(docker images -f "dangling=true" -q)
3 | docker images
--------------------------------------------------------------------------------
/StandAlone.NETCoreApp/create.nanoserver-1903.ps1:
--------------------------------------------------------------------------------
1 | docker build -t sheyenrath/wiremock.net-nanoserver-1903 -f .\Dockerfile.nanoserver-1903 .
2 | docker rmi $(docker images -f "dangling=true" -q)
3 | docker images
--------------------------------------------------------------------------------
/StandAlone.NETCoreApp/create.nanoserver-1909.ps1:
--------------------------------------------------------------------------------
1 | docker build -t sheyenrath/wiremock.net-nanoserver-1909 -f .\Dockerfile.nanoserver-1909 .
2 | docker rmi $(docker images -f "dangling=true" -q)
3 | docker images
--------------------------------------------------------------------------------
/StandAlone.NETCoreApp/create.ps1:
--------------------------------------------------------------------------------
1 | docker build -t sheyenrath/wiremock.net -f .\Dockerfile .
2 | docker tag sheyenrath/wiremock.net:latest sheyenrath/wiremock.net:1.8.5
3 | docker rmi $(docker images -f "dangling=true" -q)
4 | docker images
--------------------------------------------------------------------------------
/StandAlone.NETCoreApp/create.windows-2019.ps1:
--------------------------------------------------------------------------------
1 | docker build -t sheyenrath/wiremock.net-windows-2019 -f .\Dockerfile.windows-2019 .
2 | docker rmi $(docker images -f "dangling=true" -q)
3 | docker images
--------------------------------------------------------------------------------
/StandAlone.NETCoreApp/create_how_to.md:
--------------------------------------------------------------------------------
1 | # How to manually create image for Windows-Nano
2 |
3 | ## Windows Nano 1809
4 |
5 | ### 1. Build
6 |
7 | ``` cmd
8 | docker build -t sheyenrath/wiremock.net-nanoserver-1809 -f .\Dockerfile.nanoserver-1809 .
9 | ```
10 |
11 | ### 2. Stop
12 | ``` ps
13 | docker rm -f $(docker ps -a -q)
14 | ```
15 |
16 | ### 3. Delete dangling images
17 |
18 | ``` ps
19 | docker rmi $(docker images -f "dangling=true" -q)
20 | ```
21 |
22 | ### 4. Tag
23 |
24 | ``` cmd
25 | docker tag sheyenrath/wiremock.net-nanoserver-1809:latest sheyenrath/wiremock.net-nanoserver-1809:1.8.5
26 | ```
27 |
28 | ### 5. Push
29 |
30 | ``` cmd
31 | docker push sheyenrath/wiremock.net-nanoserver-1809:latest
32 | docker push sheyenrath/wiremock.net-nanoserver-1809:1.8.5
33 | ```
--------------------------------------------------------------------------------
/WireMock.Net Docker Solution.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.2.32505.173
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StandAlone.NETCoreApp", "StandAlone.NETCoreApp\StandAlone.NETCoreApp.csproj", "{053EA9FA-E42A-4E57-9EC5-7F0F2D6E4014}"
7 | EndProject
8 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{5AC62511-0096-4DE2-A53D-A899F8F5FD4A}"
9 | ProjectSection(SolutionItems) = preProject
10 | azure-pipelines-alpine.yml = azure-pipelines-alpine.yml
11 | azure-pipelines-arm.yml = azure-pipelines-arm.yml
12 | azure-pipelines-windows-2019.yml = azure-pipelines-windows-2019.yml
13 | azure-pipelines-windows.yml = azure-pipelines-windows.yml
14 | azure-pipelines.nano.yml = azure-pipelines.nano.yml
15 | azure-pipelines.yml = azure-pipelines.yml
16 | StandAlone.NETCoreApp\docker-compose.yml = StandAlone.NETCoreApp\docker-compose.yml
17 | GitHubReleaseNotes.txt = GitHubReleaseNotes.txt
18 | README.md = README.md
19 | ReleaseNotes.md = ReleaseNotes.md
20 | trivy.cmd = trivy.cmd
21 | EndProjectSection
22 | EndProject
23 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Kubernetes Examples", "Kubernetes Examples", "{F5A303C2-FAF0-44D8-90B7-986886474E09}"
24 | ProjectSection(SolutionItems) = preProject
25 | Kubernetes Examples\kubernetes-deployment.yml = Kubernetes Examples\kubernetes-deployment.yml
26 | Kubernetes Examples\kubernetes-pod.yml = Kubernetes Examples\kubernetes-pod.yml
27 | Kubernetes Examples\kubernetes-rs.yml = Kubernetes Examples\kubernetes-rs.yml
28 | Kubernetes Examples\kubernetes.yml = Kubernetes Examples\kubernetes.yml
29 | EndProjectSection
30 | EndProject
31 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Docker Compose Examples", "Docker Compose Examples", "{4D4CD46C-319A-47FB-AE2A-113B194AA15C}"
32 | EndProject
33 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Linux", "Linux", "{89B82E51-DCDA-4587-921A-9B6DA2169926}"
34 | ProjectSection(SolutionItems) = preProject
35 | Docker Compose Examples\Linux\docker-compose.yml = Docker Compose Examples\Linux\docker-compose.yml
36 | EndProjectSection
37 | EndProject
38 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Linux - Alpine", "Linux - Alpine", "{88688E5D-6C62-4B3B-BE82-F958F56271E9}"
39 | ProjectSection(SolutionItems) = preProject
40 | Docker Compose Examples\Linux - Alpine\docker-compose.yml = Docker Compose Examples\Linux - Alpine\docker-compose.yml
41 | EndProjectSection
42 | EndProject
43 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Linux - Alpine 2", "Linux - Alpine 2", "{4BE666E8-07E3-4B22-99DA-A2F24A02EA19}"
44 | ProjectSection(SolutionItems) = preProject
45 | Docker Compose Examples\Linux - Alpine 2\docker-compose.yml = Docker Compose Examples\Linux - Alpine 2\docker-compose.yml
46 | EndProjectSection
47 | EndProject
48 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StandAlone.NETCoreApp.Local", "StandAlone.NETCoreApp.Local\StandAlone.NETCoreApp.Local.csproj", "{E021E024-A15A-482F-BBDF-E6162278C33C}"
49 | EndProject
50 | Global
51 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
52 | Debug|Any CPU = Debug|Any CPU
53 | Release|Any CPU = Release|Any CPU
54 | EndGlobalSection
55 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
56 | {053EA9FA-E42A-4E57-9EC5-7F0F2D6E4014}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
57 | {053EA9FA-E42A-4E57-9EC5-7F0F2D6E4014}.Debug|Any CPU.Build.0 = Debug|Any CPU
58 | {053EA9FA-E42A-4E57-9EC5-7F0F2D6E4014}.Release|Any CPU.ActiveCfg = Release|Any CPU
59 | {053EA9FA-E42A-4E57-9EC5-7F0F2D6E4014}.Release|Any CPU.Build.0 = Release|Any CPU
60 | {E021E024-A15A-482F-BBDF-E6162278C33C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
61 | {E021E024-A15A-482F-BBDF-E6162278C33C}.Debug|Any CPU.Build.0 = Debug|Any CPU
62 | {E021E024-A15A-482F-BBDF-E6162278C33C}.Release|Any CPU.ActiveCfg = Release|Any CPU
63 | {E021E024-A15A-482F-BBDF-E6162278C33C}.Release|Any CPU.Build.0 = Release|Any CPU
64 | EndGlobalSection
65 | GlobalSection(SolutionProperties) = preSolution
66 | HideSolutionNode = FALSE
67 | EndGlobalSection
68 | GlobalSection(NestedProjects) = preSolution
69 | {89B82E51-DCDA-4587-921A-9B6DA2169926} = {4D4CD46C-319A-47FB-AE2A-113B194AA15C}
70 | {88688E5D-6C62-4B3B-BE82-F958F56271E9} = {4D4CD46C-319A-47FB-AE2A-113B194AA15C}
71 | {4BE666E8-07E3-4B22-99DA-A2F24A02EA19} = {4D4CD46C-319A-47FB-AE2A-113B194AA15C}
72 | EndGlobalSection
73 | GlobalSection(ExtensibilityGlobals) = postSolution
74 | SolutionGuid = {EFD20BD3-6DD3-4AC5-AAFE-E33F89A4653A}
75 | EndGlobalSection
76 | EndGlobal
77 |
--------------------------------------------------------------------------------
/azure-pipelines-alpine.yml:
--------------------------------------------------------------------------------
1 | variables:
2 | buildConfiguration: 'Release'
3 | imageName: 'wiremock.net-alpine'
4 | buildProjects: '**/StandAlone.NETCoreApp.csproj'
5 | tag: '1.8.5'
6 |
7 | trigger: none
8 |
9 | pool:
10 | vmImage: 'Ubuntu-latest'
11 |
12 | steps:
13 | - task: UseDotNet@2
14 | inputs:
15 | packageType: 'sdk'
16 | version: 8.0.x
17 |
18 | - task: DotNetCoreCLI@2
19 | displayName: Build StandAlone.NETCoreApp
20 | inputs:
21 | command: 'build'
22 | arguments: /p:Configuration=$(buildConfiguration)
23 | projects: $(buildProjects)
24 |
25 | - task: Docker@2
26 | displayName: 'Build Docker [$(imageName)(latest,$(tag)]'
27 | inputs:
28 | command: 'build'
29 | containerRegistry: 'DockerRegistry'
30 | repository: '$(DOCKER_ID)/$(imageName)'
31 | dockerfile: '$(Build.SourcesDirectory)/StandAlone.NETCoreApp/Dockerfile.alpine'
32 | tags: |
33 | $(tag)
34 | latest
35 |
36 | - task: Docker@2
37 | displayName: 'Push Docker [$(imageName)(latest,$(tag)]'
38 | inputs:
39 | command: 'push'
40 | containerRegistry: 'DockerRegistry'
41 | repository: '$(DOCKER_ID)/$(imageName)'
42 | dockerfile: '$(Build.SourcesDirectory)/StandAlone.NETCoreApp/Dockerfile.alpine'
43 | tags: |
44 | $(tag)
45 | latest
--------------------------------------------------------------------------------
/azure-pipelines-arm.yml:
--------------------------------------------------------------------------------
1 | variables:
2 | buildConfiguration: 'Release'
3 | imageNameArm: 'wiremock.net-arm$(arm-version)'
4 | buildProjects: '**/StandAlone.NETCoreApp.csproj'
5 | tag: '1.8.5'
6 | deleteDangling: '$(deleteDanglingImages)'
7 |
8 | trigger: none
9 |
10 | jobs:
11 | - job:
12 | displayName: Build and create Docker image (SelfHosted)
13 | pool:
14 | name: 'MyBuildPool'
15 | demands:
16 | - Agent.ComputerName -equals raspberrypi
17 |
18 | steps:
19 | - task: UseDotNet@2
20 | displayName: 'Install .NET Core SDK'
21 | inputs:
22 | version: 8.0.x
23 |
24 | - task: DotNetCoreCLI@2
25 | displayName: Build StandAlone.NETCoreApp
26 | inputs:
27 | command: 'build'
28 | arguments: /p:Configuration=$(buildConfiguration)
29 | projects: $(buildProjects)
30 |
31 | - task: Docker@2
32 | displayName: 'Docker info'
33 | inputs:
34 | command: 'info'
35 |
36 | - task: Docker@2
37 | displayName: 'Build Docker [$(imageNameArm)(latest,$(tag)]'
38 | inputs:
39 | command: 'build'
40 | containerRegistry: 'DockerRegistry'
41 | repository: '$(DOCKER_ID)/$(imageNameArm)'
42 | dockerfile: '$(Build.SourcesDirectory)/StandAlone.NETCoreApp/Dockerfile.arm-$(arm-version)'
43 | tags: |
44 | $(tag)
45 | latest
46 |
47 | - task: Docker@2
48 | displayName: 'Push Docker [$(imageNameArm)(latest,$(tag)]'
49 | inputs:
50 | command: 'push'
51 | containerRegistry: 'DockerRegistry'
52 | repository: '$(DOCKER_ID)/$(imageNameArm)'
53 | dockerfile: '$(Build.SourcesDirectory)/StandAlone.NETCoreApp/Dockerfile.arm-$(arm-version)'
54 | tags: |
55 | $(tag)
56 | latest
57 |
58 | - script: docker rmi $(DOCKER_ID)/$(imageNameArm)
59 | displayName: Delete Docker image [$(imageNameArm):latest]'
60 |
61 | - script: docker rmi $(DOCKER_ID)/$(imageNameArm):$(tag)
62 | displayName: Delete Docker image [$(imageNameArm):$(tag)]'
63 |
64 | - task: PowerShell@2
65 | condition: and(succeeded(), eq(variables['deleteDangling'], 'yes'))
66 | displayName: Delete dangling Docker images
67 | inputs:
68 | targetType: inline
69 | script: docker rmi $(docker images --filter "dangling=true" --quiet)
--------------------------------------------------------------------------------
/azure-pipelines-windows-2019.yml:
--------------------------------------------------------------------------------
1 | variables:
2 | buildConfiguration: 'Release'
3 | imageName: 'wiremock.net-windows-2019'
4 | buildProjects: '**/StandAlone.NETCoreApp.csproj'
5 | tag: '1.8.5'
6 |
7 | trigger: none
8 |
9 | pool:
10 | vmImage: 'windows-2019'
11 |
12 | steps:
13 | - task: UseDotNet@2
14 | displayName: 'Install .NET Core SDK'
15 | inputs:
16 | version: 8.0.x
17 |
18 | # Build StandAlone.NETCoreApp
19 | - task: DotNetCoreCLI@2
20 | displayName: Build StandAlone.NETCoreApp
21 | inputs:
22 | command: 'build'
23 | arguments: /p:Configuration=$(buildConfiguration)
24 | projects: $(buildProjects)
25 |
26 | - task: Docker@2
27 | displayName: 'Build Docker [$(imageName)(latest,$(tag)]'
28 | inputs:
29 | command: 'build'
30 | containerRegistry: 'DockerRegistry'
31 | repository: '$(DOCKER_ID)/$(imageName)'
32 | dockerfile: '$(Build.SourcesDirectory)/StandAlone.NETCoreApp/Dockerfile.windows-2019'
33 | tags: |
34 | $(tag)
35 | latest
36 |
37 | - task: Docker@2
38 | displayName: 'Push Docker [$(imageName)(latest,$(tag)]'
39 | inputs:
40 | command: 'push'
41 | containerRegistry: 'DockerRegistry'
42 | repository: '$(DOCKER_ID)/$(imageName)'
43 | dockerfile: '$(Build.SourcesDirectory)/StandAlone.NETCoreApp/Dockerfile.windows-2019'
44 | tags: |
45 | $(tag)
46 | latest
--------------------------------------------------------------------------------
/azure-pipelines-windows.yml:
--------------------------------------------------------------------------------
1 | variables:
2 | buildConfiguration: 'Release'
3 | imageName: 'wiremock.net-windows'
4 | buildProjects: '**/StandAlone.NETCoreApp.csproj'
5 | tag: '1.8.5'
6 |
7 | trigger: none
8 |
9 | pool:
10 | vmImage: 'windows-2022'
11 |
12 | steps:
13 | - task: UseDotNet@2
14 | displayName: 'Install .NET Core SDK'
15 | inputs:
16 | version: 8.0.x
17 |
18 | # Build StandAlone.NETCoreApp
19 | - task: DotNetCoreCLI@2
20 | displayName: Build StandAlone.NETCoreApp
21 | inputs:
22 | command: 'build'
23 | arguments: /p:Configuration=$(buildConfiguration)
24 | projects: $(buildProjects)
25 |
26 | - task: Docker@2
27 | displayName: 'Build Docker [$(imageName)(latest,$(tag)]'
28 | inputs:
29 | command: 'build'
30 | containerRegistry: 'DockerRegistry'
31 | repository: '$(DOCKER_ID)/$(imageName)'
32 | dockerfile: '$(Build.SourcesDirectory)/StandAlone.NETCoreApp/Dockerfile.windows'
33 | tags: |
34 | $(tag)
35 | latest
36 |
37 | - task: Docker@2
38 | displayName: 'Push Docker [$(imageName)(latest,$(tag)]'
39 | inputs:
40 | command: 'push'
41 | containerRegistry: 'DockerRegistry'
42 | repository: '$(DOCKER_ID)/$(imageName)'
43 | dockerfile: '$(Build.SourcesDirectory)/StandAlone.NETCoreApp/Dockerfile.windows'
44 | tags: |
45 | $(tag)
46 | latest
--------------------------------------------------------------------------------
/azure-pipelines.nano.yml:
--------------------------------------------------------------------------------
1 | variables:
2 | buildConfiguration: 'Release'
3 | imageNameNano: 'wiremock.net-nanoserver-$(nano-version)'
4 | buildProjects: '**/StandAlone.NETCoreApp.csproj'
5 | tag: '1.8.5'
6 | deleteDangling: '$(deleteDanglingImages)'
7 |
8 | trigger: none
9 |
10 | jobs:
11 | - job:
12 | displayName: Build and create Docker image (SelfHosted)
13 | pool:
14 | name: 'MyBuildPool'
15 | demands:
16 | - Agent.OS -equals Windows_NT
17 |
18 | steps:
19 | - task: UseDotNet@2
20 | displayName: 'Install .NET Core SDK'
21 | inputs:
22 | version: 8.0.x
23 |
24 | - task: DotNetCoreCLI@2
25 | displayName: Build StandAlone.NETCoreApp
26 | inputs:
27 | command: 'build'
28 | arguments: /p:Configuration=$(buildConfiguration)
29 | projects: $(buildProjects)
30 |
31 | - task: Docker@2
32 | displayName: 'Docker info'
33 | inputs:
34 | command: 'info'
35 |
36 | - task: PowerShell@2
37 | condition: and(succeeded(), eq(variables['deleteDangling'], 'yes'))
38 | displayName: Delete dangling Docker images (before)
39 | continueOnError: true
40 | inputs:
41 | targetType: inline
42 | script: docker rmi $(docker images --filter "dangling=true" --quiet)
43 |
44 | - task: Docker@2
45 | displayName: 'Build Docker [$(imageNameNano)(latest,$(tag)]'
46 | inputs:
47 | command: 'build'
48 | containerRegistry: 'DockerRegistry'
49 | repository: '$(DOCKER_ID)/$(imageNameNano)'
50 | dockerfile: '$(Build.SourcesDirectory)/StandAlone.NETCoreApp/Dockerfile.nanoserver-$(nano-version)'
51 | tags: |
52 | $(tag)
53 | latest
54 |
55 | - task: Docker@2
56 | displayName: 'Push Docker [$(imageNameNano)(latest,$(tag)]'
57 | inputs:
58 | command: 'push'
59 | containerRegistry: 'DockerRegistry'
60 | repository: '$(DOCKER_ID)/$(imageNameNano)'
61 | dockerfile: '$(Build.SourcesDirectory)/StandAlone.NETCoreApp/Dockerfile.nanoserver-$(nano-version)'
62 | tags: |
63 | $(tag)
64 | latest
65 |
66 | - script: docker rmi $(DOCKER_ID)/$(imageNameNano)
67 | displayName: Delete Docker image [$(imageNameNano):latest]'
68 |
69 | - script: docker rmi $(DOCKER_ID)/$(imageNameNano):$(tag)
70 | displayName: Delete Docker image [$(imageNameNano):$(tag)]'
71 |
72 | - task: PowerShell@2
73 | condition: and(succeeded(), eq(variables['deleteDangling'], 'yes'))
74 | displayName: Delete dangling Docker images (after)
75 | inputs:
76 | targetType: inline
77 | script: docker rmi $(docker images --filter "dangling=true" --quiet)
--------------------------------------------------------------------------------
/azure-pipelines.yml:
--------------------------------------------------------------------------------
1 | variables:
2 | buildConfiguration: 'Release'
3 | imageName: 'wiremock.net'
4 | buildProjects: '**/StandAlone.NETCoreApp.csproj'
5 | tag: '1.8.5'
6 |
7 | trigger: none
8 |
9 | pool:
10 | vmImage: 'Ubuntu-latest'
11 |
12 | steps:
13 | - task: UseDotNet@2
14 | inputs:
15 | packageType: 'sdk'
16 | version: 8.0.x
17 |
18 | - task: DotNetCoreCLI@2
19 | displayName: Build StandAlone.NETCoreApp
20 | inputs:
21 | command: 'build'
22 | arguments: /p:Configuration=$(buildConfiguration)
23 | projects: $(buildProjects)
24 |
25 | - task: Docker@2
26 | displayName: 'Build Docker [$(imageName)(latest,$(tag)]'
27 | inputs:
28 | command: 'build'
29 | containerRegistry: 'DockerRegistry'
30 | repository: '$(DOCKER_ID)/$(imageName)'
31 | dockerfile: '$(Build.SourcesDirectory)/StandAlone.NETCoreApp/Dockerfile'
32 | tags: |
33 | $(tag)
34 | latest
35 |
36 | - task: Docker@2
37 | displayName: 'Push Docker [$(imageName)(latest,$(tag)]'
38 | inputs:
39 | command: 'push'
40 | containerRegistry: 'DockerRegistry'
41 | repository: '$(DOCKER_ID)/$(imageName)'
42 | dockerfile: '$(Build.SourcesDirectory)/StandAlone.NETCoreApp/Dockerfile'
43 | tags: |
44 | $(tag)
45 | latest
--------------------------------------------------------------------------------
/trivy.cmd:
--------------------------------------------------------------------------------
1 | docker run --rm aquasec/trivy image sheyenrath/wiremock.net
2 |
3 | docker run --rm aquasec/trivy image sheyenrath/wiremock.net-alpine
--------------------------------------------------------------------------------