Open mayurwaghmode opened 1 year ago
Related to containers:
List running containers:
docker ps
List all containers:
docker ps -a
Access a running container:
docker exec -it <container id> bash
Remove all stopped containers:
docker container prune
Delete all running and stopped containers:
docker container rm -f $(docker ps -aq)
Start a stopped container:
docker start <containerName>
Restart (stop + start) the container:
docker restart ID
Rename a container:
docker rename <containerName> <newContainerName>
Show all modified files in a container:
docker diff <containerName>
Related to the system and volumes:
Clean the system (meta images and stopped containers):
docker system prune = docker container prune + docker image prune
Remove volumes:
docker volume prune
Publishing Container to Quay
docker login quay.io (will now be prompted for username + password)
docker ps -l
docker commit <containerId> quay.io/<myUsername>/<myRegistry>
docker push quay.io/<myUsername>/<myRegistry>
Pull image
docker pull <imageName>
Build an image from a specified docker file:
docker build <path to the dockerfile>
List all images:
docker images
Remove an image:
docker rmi <imageID>
Save an image into a tar file:
docker save <imageName> > <tarFile>
Load an Image from a tar file:
docker load -i <tarFile>