Skip to content

Instantly share code, notes, and snippets.

@amaalzohny
Created April 9, 2018 09:56
Show Gist options
  • Save amaalzohny/4a59758841d44494444d3553eb37e5a5 to your computer and use it in GitHub Desktop.
Save amaalzohny/4a59758841d44494444d3553eb37e5a5 to your computer and use it in GitHub Desktop.
docker
#can list running containers, stop the relevant container and then remove the image:
docker ps
docker stop <containerid>
docker rm <containerid>
docker rmi <imageid>
#If you cannnot find container by docker ps, you can use this to list all already exited containers and remove them.
docker ps -a | grep 60afe4036d97
docker rm <containerid>
#Note: Be careful of deleting all exited containers at once in case you use Volume-Only containers. These stay in Exit state, but contains useful data.
@amaalzohny
Copy link
Author

#List all containers (only IDs)
docker ps -aq
#Stop all running containers
docker stop $(docker ps -aq)
#Remove all containers
docker rm $(docker ps -aq)
#Remove all images
docker rmi $(docker images -q)

@amaalzohny
Copy link
Author

amaalzohny commented Apr 12, 2018

after zip files from Mac Zip tool i got error when i deploy to aws multicontainers , i have found solution is after you zip your file
run this command

zip -d docker-multicontainer-v2-src.zip __MACOSX/*

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment