-
Notifications
You must be signed in to change notification settings - Fork 3
Helpful Docker Commands
e.g.
docker image inspect 5871e133549f
or to find out what architecture the image is built for
lee-169142:~ sserbin$ docker image inspect 5871e133549f | grep Architecture
"Architecture": "arm64",
You can cleanup (prune) your environment to remove any images that are unused by taking up space on your computer
To cleanup unused images:
docker image prune
You can also remove specific images. E.g.
First do
docker image ls
Then identify the ID of the image to remove, e.g. 2bb301e6a312
you can then delete by typing
docker image rm -f 2bb301e6a312
To cleanup old volumes:
docker volume prune
You can remove any containers you aren't using, however (warning!!) this would remove your ELM or Jupyter containers if not running:
docker container prune
You can cleanup everything at once using:
docker system prune
The docker system prune command is a shortcut that prunes images, containers, and networks. Volumes are not pruned by default, and you must specify the --volumes
flag for docker system prune to prune volumes, e.g.
docker system prune --volumes
https://docs.docker.com/engine/reference/commandline/save/
e.g. Save your local copy of the ELM Docker image to a tar file
docker save serbinsh/ngeearctic_elm_containers:elm_v2-for-ngee_multiarch > testdocker.tar
e.g. Save your local copy of the ELM Docker image to a tar.gz file
docker save serbinsh/ngeearctic_elm_containers:elm_v2-for-ngee_multiarch | gzip > testdocker.tar.gz
Load Docker image from file
https://docs.docker.com/engine/reference/commandline/load/
e.g. Reload from a tar.gz file
docker load < testdocker.tar.gz