Docker
List images
docker images
Clean up images
Remove all images tagged as “none”
docker system prune
Delete specific image
docker rmi \<repo name\>
List containers
docker ps
docker ps -a
docker ps -l
Clean up containers
docker rm $(docker ps -a -q --filter "ancestor=<imagename>")
Initiate an interactive docker session
docker run -it <image> /bin/bash
If you need to use a different defined ENTRYPOINT:
docker run -it --entrypoint /bin/bash <image>
“Symlink” host files/folders to running Docker process
docker run -it --mount src="$(pwd)",target=/a/full/path,type=bind <image>
Build image locally and push to Dockerhub
# in a folder containing a Dockerfile:
docker build -t <username>/<repo>:latest .
docker push <username>/<repo>:latest
General tutorial
https://ropenscilabs.github.io/r-docker-tutorial/