Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker commands #3

Open
mayurwaghmode opened this issue Jul 5, 2022 · 4 comments
Open

Docker commands #3

mayurwaghmode opened this issue Jul 5, 2022 · 4 comments

Comments

@mayurwaghmode
Copy link
Owner

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>

@mayurwaghmode
Copy link
Owner Author

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>

@mayurwaghmode
Copy link
Owner Author

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

@mayurwaghmode
Copy link
Owner Author

mayurwaghmode commented Jul 14, 2022

@mayurwaghmode
Copy link
Owner Author

mayurwaghmode commented Aug 3, 2022

Publishing Container to Quay

Login to Quay.io

docker login quay.io (will now be prompted for username + password)

Get your containerID

docker ps -l

Tag that container by containerId

docker commit <containerId> quay.io/<myUsername>/<myRegistry>

Now publish it to Quay.io

docker push quay.io/<myUsername>/<myRegistry>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant