Docker Environment - SCECcode/ucvm_docker GitHub Wiki

Docker Client Software

Docker is an open-source platform to build, distribute, and run applications, whether on laptops, data center virtual machines, or the cloud with OS-level virtualization.

Getting Docker in a nutshell

  • Download and install the Docker client from Dockerhub Home Page.
  • Create a Docker user account on Dockerhub.
  • Log into Dockerhub. This enables access to Docker images on Dockerhub.
  • Start the Docker client on a laptop. On a Mac, a Docker client is started by double clicking on the Docker icon (which is a whale) in the applications directory.

Manipulate the container

$ docker --help
$ docker container

Inspect an image

# first, get the images on your system and their ids
$ docker images
# use one of those ids to take a closer look
$ docker inspect image-id

Basic Docker Commands

# This lists images and containers in the local host
$ docker ps -a
# This command builds a Docker image with a tag and runs it
$ docker build --rm -t ucvm:06291139 .
$ docker run -it ucvm:06291139

# This command lists Docker images from Dockerhub under sceccode name space 
$ docker search sceccode/ucvm
# This command pulls a Docker image from Dockerhub to local host
$ docker pull image-id

Kill all running container and Delete ALL images

$ docker system prune
$ docker system prune -a -f --volumes
$ docker kill $(docker ps -q)
$ docker rm $(docker ps -a -q)
$ docker rm -f $(docker ps -a -q)
$ docker rmi $(docker images -q)

Delete all 'untagged/dangling' images

$ docker rmi $(docker images -q -f dangling=true)
$ docker rmi $(docker images -f dangling=true -q )
$ docker rmi $(docker images -f dangling=true -q ) -f
⚠️ **GitHub.com Fallback** ⚠️