Docker ps command Use ps command to list the docker containers on your local system. Syntax docker ps [OPTIONS] Example To list all running container use the following command. $ docker ps Docker ps Options #1. List All (-a, –all) Use this switch to show all containers created on local system, either they are in any state. $ docker ps -a #2. Show ID Only (-q, –quiet) This option will only display the numeric id only of the container. $ docker ps -q #3. Show Size (-s, –size) This option…
Read MoreTag: container
Docker – Manage Ports
Manage Ports in Docker The Docker containers run services inside it on a specific port. To access that services of container running on a port, You need to bind container port with some Docker host port. Example 1 Have a look at below image. You will see that docker host is running two containers, one is running Apache which has some website and other have MySQL. Now, you need to access the website running on Apache container on port 80. Let’s bind docker host port 8080 to containers port 80.…
Read MoreDocker – Data Volumes
Docker Data Volumes In docker, data volumes are useful for managing your data with Docker containers and host machines. Here you will find two way of managing data volumes on Docker containers. Using the data volume container. Using share data between the host and the Docker container #1. Use Docker Data Volume Container The Docker data volume container is same as other containers, but they just used for storage only. You can use storage of these containers to your containers. When you write data to your containers file system, it…
Read MoreDocker – Container
Docker Container Docker container is a running instance of an image. A container combined only libraries and settings required to make the application work. It is the lightweight and portable encapsulated environment for an application. Run Docker Container Use docker run command to launch a Docker container on your system. For example below command will create a Docker container from the hello-world image. docker run hello-world Now create a real instance of Docker container using CentOS operating system. The option -it will provide an interactive session with pseudo-TTY enabled. This…
Read More