Docker [1] is a tool, which takes the burden away from you to install libraries and other dependencies to a machine, if you want to run a piece of code there. With Docker you can create containers, which contain every piece of the environment necessary to be able to execute your code. In that sense, Docker allows you to follow the principles of Infrastructure as Code. [2]
[1] https://en.wikipedia.org/wiki/Docker_(software)
[2] https://en.wikipedia.org/wiki/Infrastructure_as_code
See your running containers:
docker psStop all running containers:
docker stop $(docker ps -aq)See images on your machine:
docker imagesClean up unused images / containers:
docker image prune
docker container pruneDelete one container:
docker rm [container_id]Delete all containers:
docker rm $(docker ps -a -q)Delete all images:
docker rmi $(docker images -q)Remove all images containing the word "word":
docker images -a | grep "word" | awk '{print $3}' | xargs docker rmiForced:
docker images -a | grep "word" | awk '{print $3}' | xargs docker rmi -fDelete containers following a certain pattern:
docker ps -a | grep "pattern" | awk '{print $3}' | xargs docker rmiGo into a container:
docker exec -it [name of your container] bashPull an image from the internal docker registry, here, as part of test app:
docker pull registry.int.janelia.org/[test app]/[self-given image name]:[tag]Tag an image from the internal docker registry, here, as part of test app:
docker tag [source image:tag] registry.int.janelia.org/[test app]/[self-given image name]:[tag]Push an image to the registry, here, as part of test app:
docker push registry.int.janelia.org/[test app]/[self-given image name]:[tag]