Skip to content

Instantly share code, notes, and snippets.

@magohl
Last active June 11, 2019 06:56
Show Gist options
  • Save magohl/39669f569ea10934e9a315845e214c20 to your computer and use it in GitHub Desktop.
Save magohl/39669f569ea10934e9a315845e214c20 to your computer and use it in GitHub Desktop.
Some useful docker snippets i use...
docker run -e TZ=Europe/Stockholm x:x
Good tips:
https://runnable.com/blog/9-common-dockerfile-mistakes
docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=Very#Secret#Password' -p 1433:1433 -d microsoft/mssql-server-linux:latest
MONGO:
docker run -p 27017:27017 -d -v $PWD/data/bin:/data/bin mongo
ASPNET CORE:
export localhost/devcert to pfx for use in docker:
dotnet dev-certs https -v -ep %temp%\cert-aspnetcore.pfx -p somepass
Start ASPNET CORE container with HTTPS only incl. dev cert via volume
docker run -d -p 5009:443
-e ASPNETCORE_ENVIRONMENT=Development
-e ASPNETCORE_URLS="https://+"
-e Kestrel__Certificates__Default__Path=/root/.dotnet/https/cert-aspnetcore-dev.pfx
-e Kestrel__Certificates__Default__Password=somepass
-v %temp%:/root/.dotnet/https
mycontainer:latest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment