port mapping
docker run -idt -p 80 microsoft/dotnet-samples:aspnetapp
docker container ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
4ae023c7b5de microsoft/dotnet-samples:aspnetapp "dotnet aspnetapp.dll" 4 minutes ago Up 4 minutes 0.0.0.0:54376->80/tcp demo
80
32768
32769
docker host
mac/win
80
docker container port <container id/name>
http://docker_host_ip:port
To access web app
docker container rename <container id/name> app
docker container top app
docker container inspect app
See if you could find the
echo This is a sample text file > sample.txt
docker cp sample.txt vote:/opt/
docker cp vote:app .
docker diff vote
docker diff stats
A : Added
C : Changed
D : Deleted
docker container stats
(^c to exit)
docker container stats --no-stream=true
stats command is based on cgroups. cgroups provide accounting of resources in addition to setting resource limits
docker container inspect demo | systeminfo |find "Available Physical Memory"
docker container stats --no-stream=true
docker update --memory 400M --memory-swap -1 app
docker container stats --no-stream=true
docker container stats
Open a new terminal and keep the following command running to check stats
docker run -d --name st-01 --cpu-shares 512 microsoft/dotnet-samples:aspnetapp stress --cpu 1
docker run -d --name st-02 --cpu-shares 1024 microsoft/dotnet-samples:aspnetapp stress --cpu 1
docker run -d --name st-03 --cpu-shares 1024 microsoft/dotnet-samples:aspnetapp stress --cpu 1
docker run -d --name st-04 --cpu-shares 512 microsoft/dotnet-samples:aspnetapp stress --cpu 1
Launch containers with --cpu-shares
docker container stop st-01 st-02 st-03 st-04
docker container ps -a
docker system df
docker container prune