Skip to content

Instantly share code, notes, and snippets.

@Wapiti08
Last active February 25, 2021 12:48
Show Gist options
  • Save Wapiti08/d9398cb02328c8120b315077d292e4c6 to your computer and use it in GitHub Desktop.
Save Wapiti08/d9398cb02328c8120b315077d292e4c6 to your computer and use it in GitHub Desktop.
Docker Usage Examples

1. Check the live docker instances:

docker ps

2. Stop an instance with the container ID:

docker stop 71f1db29d705 

3. Show all the docker images:

docker image ls

or

docker images

4. Delete a image with ID:

docker rmi xx

sometimes you need add -f(force) option:

docker rmi -f xx

5. Delete all containers and their volumns use:

docker rm -vf $(docker ps -a -q)

6. Delete all the images:

docker rmi -f $(docker images -a -q)

7. Enter into a docker:

docker exec -it --user root "webserver image ID" /bin/bash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment