Tutorial by Examples

Ordinarily, images are pulled automatically from Docker Hub. Docker will attempt to pull any image from Docker Hub that doesn't already exist on the Docker host. For example, using docker run ubuntu when the ubuntu image is not already on the Docker host will cause Docker to initiate a pull of the l...
$ docker images REPOSITORY TAG IMAGE ID CREATED SIZE hello-world latest 693bce725149 6 days ago 967 B postgres 9.5 0f3af79d8673 10 weeks ago 265.7 MB postgres ...
Docker commands which take the name of an image accept four different forms: TypeExampleShort ID693bce725149Namehello-world (defaults to :latest tag)Name+taghello-world:latestDigesthello-world@sha256:e52be8ffeeb1f374f440893189cd32f44cb166650e7ab185fa7735b7dc48d619 Note: You can only refer to an im...
The docker rmi command is used to remove images: docker rmi <image name> The full image name must be used to remove an image. Unless the image has been tagged to remove the registry name, it needs to be specified. For example: docker rmi registry.example.com/username/myAppImage:1.3.5 I...
You can search Docker Hub for images by using the search command: docker search <term> For example: $ docker search nginx NAME DESCRIPTION STARS OFFICIAL AUTOMATED nginx Official build of Nginx. ...
docker inspect <image> The output is in JSON format. You can use jq command line utility to parse and print only the desired keys. docker inspect <image> | jq -r '.[0].Author' The above command will shows author name of the images.
Tagging an image is useful for keeping track of different image versions: docker tag ubuntu:latest registry.example.com/username/ubuntu:latest Another example of tagging: docker tag myApp:1.4.2 myApp:latest docker tag myApp:1.4.2 registry.example.com/company/myApp:1.4.2
docker save -o ubuntu.latest.tar ubuntu:latest This command will save the ubuntu:latest image as a tarball archive in the current directory with the name ubuntu.latest.tar. This tarball archive can then be moved to another host, for example using rsync, or archived in storage. Once the tarball h...

Page 1 of 1