Docker Run Command Cheat Sheet

docker container run --name web -p
5000:80 alpine:3.9
Run a container from the Alpine version 3.9
image, name the running container
“web” and expose port 5000 externally,
mapped to port 80 inside the container.
docker container stop webStop a running container through SIGTERM
docker container kill webStop a running container through SIGKILL
docker network lsList the networks
docker container lsList the running containers (add –all to
include stopped containers)
docker container rm -f $(docker ps -aq)Delete all running and stopped containers
docker container
logs --tail 100 web
Print the last 100
lines of a container’s logs

Leave a Reply

Your email address will not be published. Required fields are marked *