Common Docker image and container management commands
Introduction The docker command now consists of multiple management commands having related sub-commands embedded within them. Some of the examples of management commands are builder, config, container, image, network, etc. You could view the full list of management commands available with docker by typing docker –help. In this article, we’ll discuss the sub-commands associated with two of the management commands namely image and container as we are likely to use them the most while working with docker. We’ll start with docker images. To view a list of available commands with the docker image command type docker image –help. List images: To list images we use docker image ls. [sahil@linuxnix ~]$ docker image ls REPOSITORY TAG IMAGE ID CREATED SIZE [sahil@linuxnix ~]$ Download an image: From the docker image ls command output, we determined that we don’t have any image on the system. So, let’s download an image using the docker image pull command. [sahil@linuxnix ~]$ docker image pull nginx Using default tag: latest latest: Pulling from library/nginx f5d23c7fed46: Pull complete 918b255d86e5: Pull complete 8c0120a6f561: Pull complete Digest: sha256:eb3320e2f9ca409b7c0aa71aea3cf7ce7d018f03a372564dbdb023646958770b Status: Downloaded newer image for nginx:latest docker.io/library/nginx:latest Here we pulled an image comprising the nginx web server installed from the Docker Hub. We’ll talk in detail about what happens during an image pull in a separate post docker images. Fetch image details: To view details about an image type docker image...
Read More