Deploy+Static+HTML+to+docker+container
Deploy+Static+HTML+to+docker+container
Docker container
dotnetmastery.com
DOCKER – file creation
docker file has no extension
For creating a docker container we need docker
image
For importing image we use FROM keyword
dotnetmastery.com
DOCKER – file creation
dotnetmastery.com
DOCKER – Build a docker
image
NOTE: docker image name should be in lower case, and the above
command should be ran in the same directory where we have
docker file created
dotnetmastery.com
DOCKER – Build a docker
image
NOTE: We can give tag to the docker image by using “:” followed by
tag
dotnetmastery.com
DOCKER – Build a docker
image
If Build is successful we will have image.
Check it by docker images
dotnetmastery.com
DOCKER – Building
Container
Docker run -–name {containername}
-p tag is used for port mapping
Followed with repository name that we have.
dotnetmastery.com
DOCKER – Port Mapping
dotnetmastery.com
Docker - PORT Mapping
http://
170.155.10.33:9000
9000
http://
170.155.10.33
80
http://172.17.0.2:80
.NET App
172.17.0.2
Internal IP
Docker Container
Docker Host
dotnetmastery.com
Docker - PORT Mapping
http:// http://
http://dotnetmastery.com
170.155.10.33:9000 localhost:9500
80 80 5000
http://172.17.0.2:80
.NET App .NET App .NET App
Docker Host
dotnetmastery.com
DOCKER – Container
Commands
NOTE: You can use either container id (full/partial till it is unique) or container name
dotnetmastery.com
DOCKER – List all
container’s
docker ps
dotnetmastery.com
DOCKER – Remove a container
docker rm d8b24f3b6773
docker rm d8b
docker rm sample-web-app-containerv2
dotnetmastery.com