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>

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/


Access a running container

https://www.rocker-project.org/use/managing_containers/