Docker
List all containers (running and exited)
docker ps -aBuild an image with a dockerfile in the current directory
docker build -t image_name:tag_name .Run a docker container
docker run image_name:tag_namedocker run -d --name container_name -p 80:80 -p 443:443 --net network_name -v /path/of/file/in/host:/path/of/file/in/container image_name:tag_name-ddetached mode--namespecify the name you want to call this container-pports mapping--netnetwork to put it on-vvolumes to mount
Start and go into interactive mode of last created container
docker start -a -i `docker ps -q -l`docker startstart a container (requires name or ID)-aattach to container-iinteractive modedocker psList containers-qlist only container IDs-llist only last created container
Start and go into interactive mode of a specific container
Remove dangling images
Last updated
Was this helpful?