Docker

Install Docker and Learn Basic Container Manipulation in CentOS and RHEL 7/6 – Part 1

Install Docker and Learn Basic Container Manipulation in CentOS and RHEL 7/6 &-8211; Part 1 &-8211; this Article or News was published on this date:2019-05-28 17:53:53 kindly share it with friends if you find it helpful

In this 3-article series, we will discuss about Docker, is an open-source lightweight virtualization tool which runs at top of Operating System level, allowing users to create, run and deploy applications, encapsulated into small containers.

Install Docker and Learn Basic Container ManipulationInstall Docker and Learn Basic Container Manipulation

Install Docker and Learn Basic Container Manipulation – Part 1

This type of Linux containers are proven to be fast, portable and secure. The processes that run in a Docker container are always isolated from the main host, preventing outside tampering.

Part 1: Install Docker and Learn Basic Container Manipulation in CentOS and RHEL 7/6

This tutorial provides a starting point on how to install Docker, create and run Docker containers on CentOS/RHEL 7/6, but barley scratches the surface of Docker.

Step 1: Install and Configure Docker

1. Docker binaries are incorporated into RHEL/CentOS 7 extras repositories, the installation process being pretty simple. Install Docker package by issuing the following command with root privileges:

Install Docker on RHEL and CentOS 7

- yum install docker
Install Docker and Learn Basic Container ManipulationInstall Docker on CentOS and RHEL 7

Install Docker on CentOS and RHEL 7

Install Docker on RHEL and CentOS 6

To install Docker, the Epel repositories must be enabled on your system by issuing the following command:

- yum install epel-release
- yum install docker-io
Install Docker and Learn Basic Container ManipulationInstall Docker on RHEL and CentOS 6

Install Docker on RHEL and CentOS 6

2. After, Docker package has been installed, start the daemon, check its status and enable it system wide using the below commands:

On RHEL/CentOS 7

- systemctl start docker 
- systemctl status docker
- systemctl enable docker
Install Docker and Learn Basic Container ManipulationEnable Docker on RHEL and CentOS 7

Enable Docker on RHEL and CentOS 7

On RHEL/CentOS 6

- service docker start
- service docker status
- chkconfig docker on
Install Docker and Learn Basic Container ManipulationEnable Docker on RHEL and CentOS 6

Enable Docker on RHEL and CentOS 6

3. Finally, run a container test image to verify if Docker works properly, by issuing the following command:

- docker run hello-world

If you can see the below message, then everything is in the right place.

"Hello from Docker. This message shows that your installation appears to be working correctly."
Install Docker and Learn Basic Container ManipulationDocker Hello World

Docker Hello World

4. Now, you can run a few basic Docker commands to get some info about Docker:

For system-wide information on Docker
- docker info
Install Docker and Learn Basic Container ManipulationCheck Docker Info

Check Docker Info

For Docker version
- docker version
Install Docker and Learn Basic Container ManipulationCheck Docker Version

Check Docker Version

5. To get a list of all available Docker commands type docker on your console.

- docker
Install Docker and Learn Basic Container ManipulationList Docker Commands

List Docker Commands

Step 2: Download a Docker Image

6. In order to start and run a Docker container, first an image must be downloaded from Docker Hub on your host. Docker Hub offers a great deal of free images from its repositories.

To search for a Docker image, Ubuntu for instance, issue the following command:

- docker search ubuntu
Install Docker and Learn Basic Container ManipulationSearch Docker Images

Search Docker Images

7. After you decided on what image you want to run based on your needs, download it locally by running the below command (in this case an Ubuntu image is downloaded and used):

- docker pull ubuntu
Install Docker and Learn Basic Container ManipulationDownload Docker Images

Download Docker Images

8. To list all the available Docker images on your host issue the following command:

- docker images
Install Docker and Learn Basic Container ManipulationList Docker Images

List Docker Images

9. If you don’t need a Docker image anymore and you want to remove it from the host issue the following command:

- docker rmi ubuntu
Install Docker and Learn Basic Container ManipulationRemove Docker Image

Remove Docker Image

Step 3: Run a Docker Container

When you execute a command against an image you basically obtain a container. After the command that is executing into container ends, the container stops (you get a non-running or exited container). If you run another command into the same image again a new container is created and so on.

All the containers created will remain on the host filesystem until you choose to delete them by using the docker rm command.

10. In order to create and run a container, you need to run a command into a downloaded image, in this case Ubuntu, so a basic command would be to display the distribution version file inside the container using cat command, as in the following example:

- docker run ubuntu cat /etc/issue
Install Docker and Learn Basic Container ManipulationRun Docker Containers

Run Docker Containers

The above command is divided as follows:

- docker run [local image] [command to run into container]

11. To run one of the containers again with the command that was executed to create it, first you must get the container ID (or the name automatically generated by Docker) by issuing the below command, which displays a list of the running and stopped (non-running) containers:

- docker ps -l 
Install Docker and Learn Basic Container ManipulationList Running Docker Containers

List Running Docker Containers

12. Once the container ID has been obtained, you can start the container again with the command that was used to create it, by issuing the following command:

- docker start c629b7d70666

Here, the string c629b7d70666 represents the container ID.

Install Docker and Learn Basic Container ManipulationStart Docker Containers

Start Docker Containers

13. In case the container is running state, you can get it’s ID by issuing docker ps command. To stop the running container issue docker stop command by specifying the container ID or auto-generated name.

- docker stop dreamy_mccarthy
- docker ps
Install Docker and Learn Basic Container ManipulationStart Stop Docker Containers

Start Stop Docker Containers

14. A more elegant alternative so you don’t have to remember the container ID would be to allocate a unique name for every container you create by using the --name option on command line, as in the following example:

- docker run --name myname  ubuntu cat /etc/debian_version
Install Docker and Learn Basic Container ManipulationAdd Name to Docker Container

Add Name to Docker Container

15. Then, using the name that you allocated for the container, you can manipulate container (start, stop, remove, top, stats) further just by addressing its name, as in the below examples:

- docker start myname
- docker stats myname
- docker top myname 

Be aware that some of the above commands might display no output if the process of command that was used to create the container finishes. When the process that runs inside the container finishes, the container stops.

Step 4: Run an Interactive Session into a Container

16. In order to interactively connect into a container shell session, and run commands as you do on any other Linux session, issue the following command:

- docker run -it ubuntu bash
Install Docker and Learn Basic Container ManipulationStart Docker Container Interactive Shell

Start Docker Container Interactive Shell

The above command is divided as follows:

  1. -i is used to start an interactive session.
  2. -t allocates a tty and attaches stdin and stdout.
  3. ubuntu is the image that we used to create the container.
  4. bash (or /bin/bash) is the command that we are running inside the Ubuntu container.

17. To quit and return to host from the running container session you must type exit command. The exit command terminates all the container processes and stops it.

- exit

18. If you’re interactively logged on container terminal prompt and you need to keep the container in running state but exit from the interactive session, you can quit the console and return to host terminal by pressing Ctrl+p and Ctrl+q keys.

Install Docker and Learn Basic Container ManipulationKeep Docker Shell Session Active

Keep Docker Shell Session Active

19. To reconnect to the running container you need the container ID or name. Issue docker ps command to get the ID or name and, then, run docker attach command by specifying container ID or name, as illustrated in the image above:

- docker attach container id>

20. To stop a running container from the host session issue the following command:

- docker kill container id>

That’s all for basic container manipulation. In the next tutorial we will discuss how to save, delete and run a web server into a Docker container.

How to Install, Run and Delete Applications inside Docker Containers – Part 2

How to Install, Run and Delete Applications inside Docker Containers &-8211; Part 2 &-8211; this Article or News was published on this date:2019-05-28 17:53:45 kindly share it with friends if you find it helpful

Following the previous Docker article, this tutorial will discuss how to save a Docker container into a new image, remove a container and run a Nginx web server inside a container.

Install and Run Applications in Docker ContainersInstall and Run Applications in Docker Containers

Install and Run Applications in Docker Containers – Part 2

Requirements

  1. Install Docker on CentOS and RHEL 7/6

How To Run and Save a Docker Container

1. In this example we will run and save an Ubuntu based Docker container where Nginx server will be installed. But before committing any changes to container, first start the container with the below command which installs Nginx daemon into Ubuntu image:

- docker run ubuntu bash -c "apt-get -y install nginx" 
Install and Run Applications in Docker ContainersInstall Nginx on Ubuntu Docker Container

Install Nginx on Ubuntu Docker Container

2. Next, after Nginx package is installed, issue the command docker ps -l to get the ID or name of the running container.

- docker ps -l
Install and Run Applications in Docker ContainersFind Docker Container ID Name

Find Docker Container ID Name

And apply changes by running the below command:

- docker commit 5976e4ae287c ubuntu-nginx

Here, 5976e4ae287c represents the container ID and ubuntu-nginx represents the name of the newly image that has been saved with committed changes.

In order to view if the new image has been successfully created just run docker images command and a listing of all saved images will be shown.

- docker images
Install and Run Applications in Docker ContainersDocker Container Changes

Docker Container Changes

Chances are that the installation process inside the container finishes fast which leads to a non-running container (container is stopped). In this case the docker ps command won’t show any output because no container is running.

In order to be able to still get the container’s id run docker ps -a | head -3 to output the most recent containers and identify the container based on the command issued to create the container and the exited status.

3. Alternatively, you can actively enter container session by running docker run -it ubuntu bash command and execute further apt-get install nginx command. While the command is running, detach from the container using Ctrl-p + Ctrl-q keys and the container will continue running even if the Nginx installation process finishes.

- docker run -it ubuntu bash
- apt-get install nginx
Install and Run Applications in Docker ContainersInstall Nginx on Docker Container

Install Nginx on Docker Container

Then, get the running container id with docker ps and commit changes. When finished, re-enter to container console using docker attach and type exit to stop container.

- docker ps
- docker attach 3378689f2069
- exit
Install and Run Applications in Docker ContainersAttach Docker Container

Attach Docker Container

4. To further test if the recently image has been committed properly (in this case Nginx service has been installed), execute the below command in order to generate a new container which will output if Nginx binary was successfully installed:

- docker run ubuntu-nginx whereis nginx
Install and Run Applications in Docker ContainersGenerate New Docker Container

Generate New Docker Container

5. To remove a container use the rm command against a container ID or name, which can be obtained using docker ps -a command:

- docker ps -a
- sudo docker rm 36488523933a
Install and Run Applications in Docker ContainersRemove Docker Container

Remove Docker Container

How to Run Nginx inside Docker Container

6. In this part we will concentrate on how you can run and access a network service, such as a Nginx web server, inside Docker, using the ubuntu-nginx image created earlier where Nginx daemon was installed.

The first thing that you need to do is to create a new container, map host-container ports and enter container shell by issuing the below command:

- docker run -it -p 81:80 ubuntu-nginx /bin/bash
- nginx &

Here, the -p option exposes the host port to container port. While the host port can be arbitrary, with the condition that it should be available (no other host services should listen on it), the container port must be exactly the port that the inside daemon is listening to.

Once you’re connected to container session, start Nginx daemon in background and detach from container console by pressing Ctrl-p + Ctrl-q keys.

Install and Run Applications in Docker ContainersRun Nginx Inside Docker Container

Run Nginx Inside Docker Container

7. Now, run docker ps to get the state of your running container. You can also view host network sockets by issuing the following command:

- docker ps
OR
- netstat -tlpn 
Install and Run Applications in Docker ContainersView Docker Container Running State

View Docker Container Running State

8. In order to visit the page served by the Nginx container, open a browser from a remote location in your LAN and type the IP address of your machine using the HTTP protocol.

Install and Run Applications in Docker ContainersVerify Nginx Running under Docker Container

Verify Nginx Running under Docker Container

9. To stop the container run the following command followed by container ID or name:

- docker ps
- docker stop fervent_mccarthy
- docker ps
Install and Run Applications in Docker ContainersStop Running Docker Container

Stop Running Docker Container

As alternative to stop the running container, enter container shell command prompt and type exit to finish process:

- docker attach fervent_mccarthy
- exit

Be aware that using this kind of containers to run web servers or other kind of services are best suited only for development purposes or tests due to the fact that the services are only active while the container is running. Exiting the container disrupts all running services or any changes made.

How to Setup a Simple Apache Web Server in a Docker Container

How to Setup a Simple Apache Web Server in a Docker Container &-8211; this Article or News was published on this date:2019-05-28 16:14:42 kindly share it with friends if you find it helpful

If you are a Linux system administrator who provides support for developers, chances are you’ve heard of Docker. If not, this software solution will make your life easier beginning today by helping you reduce operating costs and accelerate deployments – among other benefits.

But it’s not magic. Docker as a platform leverages containers – packages of an application along with all the tools it needs to run to eliminate differences between environments.

In other words, containerized software will operate and can be managed consistently regardless of where it is installed. Additionally, containers are much easier to set up, start, stop, and maintain than good old virtual machines. If you’re interested in knowing more about the differences between these two technologies, the official Docker website provides a great explanation.

To illustrate, in this article we will explain how to install Docker on CentOS 7 and Ubuntu 16.04, and spin up an Apache 2.4 container from Docker Hub.

We will then use it to serve a simple web page from our home directory – all without the need to install a web server on our host.

Installing Docker on CentOS and Ubuntu

To begin, let’s install Docker using the following command. This will download and run a shell script that will add the Docker repository to our system and install the package.

- curl -fsSL https://get.docker.com | sh

Next, use systemctl command to start the main Docker service and check its status.

- systemctl start docker
- systemctl status docker

At this point we can simply execute.

- docker

to view the list of available commands or to get help.

- docker COMMAND --help
- docker ps --help

will tell us how to list containers present on our system, whereas

- docker run --help

will print all the options that we can use to manipulate a container.

Setting Up an Apache Container

One of the amazing things about the Docker ecosystem is that there are tens of standard containers that you can easily download and use. In the following example we will instantiate an Apache 2.4 container named sfnews-web, detached from the current terminal. We will use an image called httpd:2.4 from Docker Hub.

Our plan is to have requests made to our public IP address on port 8080 be redirected to port 80 on the container. Also, instead of serving content from the container itself, we will serve a simple web page from /home/user/website.

We do this by mapping /home/user/website/ on the /usr/local/apache2/htdocs/ on the container. Note that you will need to use sudo or log in as root to proceed, and do not omit the forward slashes at the end of each directory.

- sudo docker run -dit --name sfnews-web -p 8080:80 -v /home/user/website/:/usr/local/apache2/htdocs/ httpd:2.4

At this point our Apache container should be up and running.

$ sudo docker ps
Check Apache Docker ContainerCheck Apache Docker Container

Check Apache Docker Container

Now let’s create a simple web page named docker.html inside /home/user/website directory.

- vi /home/user/website/docker.html

Add the following sample HTML content to file.

!DOCTYPE html>
html lang="en">
head>
    meta charset="UTF-8">
    title>Learn Docker at sfnews.com/title>
/head>
body>
    h1>Learn Docker With Us/h1>   
/body>
/html>

Next, point your browser to AAA.BBB.CCC.DDD:8080/docker.html (where AAA.BBB.CCC.DDD is your host’s public IP address). You should be presented with the page we created previously.

Check Apache Docker ContainerCheck Apache Page

Check Apache Page

If you wish, you can now stop the container.

$ sudo docker stop sfnews-web

and remove it:

$ sudo docker rm sfnews-web

To finish cleaning up, you may want to delete the image that was used in the container (omit this step if you’re planning on creating other Apache 2.4 containers soon).

$ sudo docker image remove httpd:2.4

Note that in all the above steps we never had to install the web server on our host.

Summary

In this article we explained how to install Docker and manipulate a container. Unfortunately, these are just the basics – there are entire courses, books, and certification exams that cover Dockers (and containers in general) more in depth.

If you want to learn more about Docker, we have already covered a 3-article series, that explains how to install Docker, run applications into containers and automatically build docker images with dockerfile.

  1. Install Docker and Learn Basic Container Manipulation in CentOS and RHEL 7/6
  2. How to Deploy and Run Applications into Docker Containers on CentOS/RHEL 7/6
  3. Automatically Build and Configure Docker Images with Dockerfile on CentOS/RHEL 7/6
  4. How to Remove Docker Images, Containers and Volumes

Consider this as your starting point and let us know if you have any questions or comments – we look forward to hearing from you!

How to Setup a Simple Apache Web Server in a Docker Container

How to Setup a Simple Apache Web Server in a Docker Container &-8211; this Article or News was published on this date:2019-05-28 16:14:42 kindly share it with friends if you find it helpful

If you are a Linux system administrator who provides support for developers, chances are you’ve heard of Docker. If not, this software solution will make your life easier beginning today by helping you reduce operating costs and accelerate deployments – among other benefits.

But it’s not magic. Docker as a platform leverages containers – packages of an application along with all the tools it needs to run to eliminate differences between environments.

In other words, containerized software will operate and can be managed consistently regardless of where it is installed. Additionally, containers are much easier to set up, start, stop, and maintain than good old virtual machines. If you’re interested in knowing more about the differences between these two technologies, the official Docker website provides a great explanation.

To illustrate, in this article we will explain how to install Docker on CentOS 7 and Ubuntu 16.04, and spin up an Apache 2.4 container from Docker Hub.

We will then use it to serve a simple web page from our home directory – all without the need to install a web server on our host.

Installing Docker on CentOS and Ubuntu

To begin, let’s install Docker using the following command. This will download and run a shell script that will add the Docker repository to our system and install the package.

- curl -fsSL https://get.docker.com | sh

Next, use systemctl command to start the main Docker service and check its status.

- systemctl start docker
- systemctl status docker

At this point we can simply execute.

- docker

to view the list of available commands or to get help.

- docker COMMAND --help
- docker ps --help

will tell us how to list containers present on our system, whereas

- docker run --help

will print all the options that we can use to manipulate a container.

Setting Up an Apache Container

One of the amazing things about the Docker ecosystem is that there are tens of standard containers that you can easily download and use. In the following example we will instantiate an Apache 2.4 container named sfnews-web, detached from the current terminal. We will use an image called httpd:2.4 from Docker Hub.

Our plan is to have requests made to our public IP address on port 8080 be redirected to port 80 on the container. Also, instead of serving content from the container itself, we will serve a simple web page from /home/user/website.

We do this by mapping /home/user/website/ on the /usr/local/apache2/htdocs/ on the container. Note that you will need to use sudo or log in as root to proceed, and do not omit the forward slashes at the end of each directory.

- sudo docker run -dit --name sfnews-web -p 8080:80 -v /home/user/website/:/usr/local/apache2/htdocs/ httpd:2.4

At this point our Apache container should be up and running.

$ sudo docker ps
Check Apache Docker ContainerCheck Apache Docker Container

Check Apache Docker Container

Now let’s create a simple web page named docker.html inside /home/user/website directory.

- vi /home/user/website/docker.html

Add the following sample HTML content to file.

!DOCTYPE html>
html lang="en">
head>
    meta charset="UTF-8">
    title>Learn Docker at sfnews.com/title>
/head>
body>
    h1>Learn Docker With Us/h1>   
/body>
/html>

Next, point your browser to AAA.BBB.CCC.DDD:8080/docker.html (where AAA.BBB.CCC.DDD is your host’s public IP address). You should be presented with the page we created previously.

Check Apache Docker ContainerCheck Apache Page

Check Apache Page

If you wish, you can now stop the container.

$ sudo docker stop sfnews-web

and remove it:

$ sudo docker rm sfnews-web

To finish cleaning up, you may want to delete the image that was used in the container (omit this step if you’re planning on creating other Apache 2.4 containers soon).

$ sudo docker image remove httpd:2.4

Note that in all the above steps we never had to install the web server on our host.

Summary

In this article we explained how to install Docker and manipulate a container. Unfortunately, these are just the basics – there are entire courses, books, and certification exams that cover Dockers (and containers in general) more in depth.

If you want to learn more about Docker, we have already covered a 3-article series, that explains how to install Docker, run applications into containers and automatically build docker images with dockerfile.

  1. Install Docker and Learn Basic Container Manipulation in CentOS and RHEL 7/6
  2. How to Deploy and Run Applications into Docker Containers on CentOS/RHEL 7/6
  3. Automatically Build and Configure Docker Images with Dockerfile on CentOS/RHEL 7/6
  4. How to Remove Docker Images, Containers and Volumes

Consider this as your starting point and let us know if you have any questions or comments – we look forward to hearing from you!

How to Remove Docker Images, Containers and Volumes

How to Remove Docker Images, Containers and Volumes &-8211; this Article or News was published on this date:2019-05-28 16:14:38 kindly share it with friends if you find it helpful

Docker is an open-source, powerful, secure, reliable and efficient container platform that enables realistic independence between applications and infrastructure. It is being widely adopted by IT and cloud companies out there, to easily to create, deploy, and run applications.

A container is a technology for visualizing operating systems, that enables an application to be packaged with everything needed to run it, allowing it to run independently from the operating system. A container image is a self-contained, executable package of an application that includes everything needed to run it: code, runtime, system tools and libraries, as well as configurations.

We have already covered a series on Docker, that explains how to install Docker, run applications into containers and automatically build docker images with dockerfile.

  1. Install Docker and Learn Basic Container Manipulation in CentOS and RHEL 7/6
  2. How to Deploy and Run Applications into Docker Containers on CentOS/RHEL 7/6
  3. Automatically Build and Configure Docker Images with Dockerfile on CentOS/RHEL 7/6
  4. How to Setup a Simple Apache Web Server in a Docker Container

In this article, we will explain how to remove docker images, containers and volumes via the docker command line tool in Linux systems.

How to Remove Docker Images

Before you remove any docker images, you can list all existing images on your system with the image management command.

$ docker image	        -list the most recently created images
OR
$ docker image -a 	-list all images

Looking at the output in the screenshot that follows, we have some images without a tag (showing instead), these are referred to as “dangling images”. They no longer have any relationship to any tagged images; they are not useful anymore and only consume disk space.

List Docker ImagesList Docker Images

List Docker Images

You can remove one or more old or unused Docker images using the image ID, for example (where d65c4d6a3580 is the image ID).

$ docker rmi d65c4d6a3580 				-remove a single image
$ docker rmi 612866ff4869 e19e33310e49 abe0cd4b2ebc	-remove multiple images

You can list dangling images (untagged images) using the -f filter flag as shown.

$ docker images -f dangling=true	
List Docker ImagesList Dangling Docker Images

List Dangling Docker Images

To remove all dangling images, allowing you to reclaim wasted disk space, use any of these commands.

$ docker image prune		-interactively remove dangling images
OR
$ docker rmi $(docker images -q -f dangling=true)
List Docker ImagesRemove All Dangling Images

Remove All Dangling Images

To remove all not associated with any container, use the following command.

$ docker image prune -a 	

How to Remove Docker Containers

You can start by listing all docker containers on your system using following command.

$ docker ps
OR
$ docker ps -a  
List Docker ImagesList Docker Containers

List Docker Containers

Once you have identified the container (s) you want to delete, you can remove them using their ID, for example.

$ docker rm 0fd99ee0cb61		-remove a single container
$ docker rm 0fd99ee0cb61 0fd99ee0cb61   -remove multiple containers

If a container is running, you can first stop it and remove it as shown.

$ docker stop 0fd99ee0cb61
$ docker rm -f 0fd99ee0cb61

You can also force-remove a container while it is running by adding the --force or -f flag, this will send it a SIGKILL signal as shown.

$ docker rm -f 0fd99ee0cb61

You can remove containers using filters as well. For example to remove all exited containers, use this command.

$ docker rm $(docker ps -qa --filter "status=exited")

To stop and remove all containers, use the following commands.

$ docker stop $(docker ps -a -q)	-stop all containers
$ docker container prune		-interactively remove all stopped containers
OR
$ docker rm $(docker ps -qa)

How To Remove Docker Volumes

As before, begin by listing all docker volumes on your system with the volume management command as shown.

$ docker volume ls

To remove one or more volumes, use the following command (note that you can’t remove a volume that is in use by a container).

$ docker volume rm volume_ID 	           -remove a single volume 
$ docker volume rm volume_ID1 volume_ID2   -remove multiple volumes

Use the -f flag to force the removal of one or more volumes.

$ docker volume rm -f volume_ID

To remove dangling volumes, use the following command.

$ docker volume rm $(docker volume ls  -q --filter dangling=true)

To remove all unused local volumes, run the following command. This will remove volumes interactively.

$ docker volume prune	

How to Remove Unused or Dangling Images, Containers, Volumes, and Networks

You can delete all dangling and unreferenced data such as containers stopped, images without containers, with this single command. By default, volumes are not removed, to prevent vital data from being deleted if there is currently no container using the volume.

$ docker system prune

To prune volumes, simply add the --volumes flag to the below command as shown.

$ docker system prune --volumes

Note: In order to run the docker command line tool without the sudo command, you need to add a user to docker group, for instance.

$ sudo usermod -a -G docker aaronkilik

For more information, see the help page for the above docker object management commands.

$ docker help
$ docker image help   
$ docker container help   
$ docker volume help   

That’s all for now! In this article, we have explained how to remove docker images, containers and volumes via the docker command line tool. If you have any questions or thoughts to share, use the feedback form below to reach us.