Using Docker on Windows to run a DNN website within a container
Review current possibilities
Review current issues
Benefits of using containers
Current issues with Windows beta support for containers
https://www.docker.com/docker-windows
docker version
docker image ls # or docker images
docker container ls # or docker ps
docker image pull microsoft/aspnet
docker container run --name=example1 -d microsoft/aspnet
docker container exec -it example1 powershell
docker container inspect example1
docker container stop example1
docker container rm example1
docker container run
--name=example2
-d
-p 12345:80
--mount type=bind,source="$PWD/images",target=C:\inetpub\wwwroot\images
microsoft/aspnet
version: '3.2'
services:
web:
image: microsoft/aspnet:4.7.1-windowsservercore-1709
ports:
- '22222:80'
volumes:
- type: bind
source: ./images
target: C:\inetpub\wwwroot\images
restart: always
version: '3.2'
services:
web: …
db:
image: microsoft/mssql-server-windows-developer:2017-latest
volumes:
- "./db/:C:/temp/"
expose:
- '1433'
environment:
ACCEPT_EULA: 'Y'
sa_password: 'DNN Summ!t'
attach_dbs: '[{
"dbName": "dnn",
"dbFiles": [
"C:\\temp\\dnn.mdf",
"C:\\temp\\dnn_log.ldf"
]
}]'
FROM microsoft/aspnet:4.7.1-windowsservercore-1709
COPY wwwroot/ C:\\inetpub\\wwwroot