-
-
Notifications
You must be signed in to change notification settings - Fork 39
/
docker-run.ps1
37 lines (34 loc) · 2 KB
/
docker-run.ps1
1
2
3
4
5
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
31
32
33
34
35
36
37
# run a container from an existing image
$imageName="pmcilreavy/azureeventgridsimulator:dev";
$containerName="azureeventgridsimulator-official";
# Build and push to docker hub
#docker buildx create --use
#docker buildx build --push --no-cache --platform linux/arm64,linux/amd64 --tag pmcilreavy/azureeventgridsimulator:3.0.4 --tag pmcilreavy/azureeventgridsimulator:latest .
#docker buildx build --push --no-cache --platform linux/arm64,linux/amd64 --tag pmcilreavy/azureeventgridsimulator:dev .
if ($(docker ps --all --filter="name=$containerName") -like "*$containerName*") {
# the container already exists to just (re)-start it
docker restart $containerName
}
else {
# create the container and run it
docker run `
--detach `
--publish 60101:60101 `
--name $containerName `
-v ${pwd}/docker:/aegs `
-e ASPNETCORE_ENVIRONMENT=Development `
-e ASPNETCORE_Kestrel__Certificates__Default__Path=/aegs/azureEventGridSimulator.pfx `
-e ASPNETCORE_Kestrel__Certificates__Default__Password=Y0urSup3rCrypt1cPa55w0rd! `
-e TZ=Australia/Brisbane `
-e AEGS_Topics__0__name=ExampleTopic `
-e AEGS_Topics__0__port=60101 `
-e AEGS_Topics__0__key=TheLocal+DevelopmentKey= `
-e AEGS_Topics__0__subscribers__0__name=RequestCatcherSubscription `
-e AEGS_Topics__0__subscribers__0__endpoint=https://azureeventgridsimulator.requestcatcher.com/ `
-e AEGS_Topics__0__subscribers__0__disableValidation=true `
-e AEGS_Topics__0__subscribers__1__name=AzureFunctionSubscription `
-e AEGS_Topics__0__subscribers__1__endpoint=http://host.docker.internal:7071/runtime/webhooks/EventGrid?functionName=ExampleFunction `
-e AEGS_Topics__0__subscribers__1__disableValidation=true `
-e AEGS_Serilog__MinimumLevel__Default=Verbose `
$imageName
}