docker container

Docker Container

Reading Time 2 minutes

A Docker Container is an encapsulated solution for running a machine with applications/software. It internalizes all dependencies allowing anyone to run a container on any machine, any cloud etc therefore making the process much more easier.

First of all, consider quickly going through ‘Installing Docker in Windows’ before continuing with this post.

Docker Container

Docker has many commands which can be used to manage containers. Some of these are:

docker --help
docker search <image>
docker pull <image>
docker images
docker run <image>
docker ps -a
docker rm <containerID>
docker rmi <image>

docker –help
docker container
‘Docker help’ is a great way of seeing a list of all the available options.

docker search
docker container
The ‘search’ command can be used to locate an image in the Docker Hub. This can be useful when trying to find a specific image to either pull or run.

Docker Image Management

docker pull
docker container
‘Pull’ is used to create an exact copy of an image from the Docker Hub in your local machine. In other words, ‘docker pull’ is used to copy the image to a hard drive. This gives the option to run the image on a machine as a container.

docker images
docker container
After an image has been pulled, it is possible to see a list of all the local images. ‘docker images’ can be used to see a list of all the images currently on a machine.

docker run
docker container
‘docker run’ can be supplied with the name of an image. This effectively tries to run the image as a container on a Docker instance.
You can supply more parameters with ‘docker run’ command, for instance:

docker run -it ubuntu bash

This will run an Ubuntu image as a container, giving control over the terminal in Ubuntu.

docker ps -a
docker container
Have you ever wondered how you can see a list of all the current containers on your machine? Well, try typing in ‘docker ps -a’, this will return all the current containers on your machine.

docker rm
docker container
It is possible to remove a container by supplying the container ID with ‘docker rm’. If the container is still running when trying to remove, you will have to stop it first. You can stop a container by:

docker rm <containerID>

docker rmi
docker container
For a given image if there are no container instances, you can remove the image by typing in ‘docker rmi ‘. This will remove the image from your machine.


Docker has a number of commands. These commands can be used to search for an image, to pull the image and to ultimately deploy an image. This gives a Docker user the control to manage an image and to turn it into a container.


I am a passionate tester, father, husband and gamer. I love to write blogs about Software Testing and generally contribute back to the Software Testing world.

More Posts - Twitter - Facebook

Published by


I am a passionate tester, father, husband and gamer. I love to write blogs about Software Testing and generally contribute back to the Software Testing world.

  • Pingback: Multiple Docker Containers - TheTestRoom()

  • Sorcerer

    I have viewed your Docker Compose video. Have a question wrt setting up the volume in a yml file for Windows environment.
    In the opensource project I want to install, there are some instructions for what the install should be in the compose file
    But most people use & deploy this project in native Linux environment (E.g. Docker in Ubuntu).
    However, I am in windows environment & I want to have data persistent.

    One of the Docker Compose example for this project, which I just named: PROJECTNAME, is given as follow:

    $ docker run –network=PROJECTNAME_default –name ldap
    –log-driver gelf
    –log-opt gelf-address=udp://:12201
    –log-opt tag=slapd
    -p 389:389
    -e SYSLOG_HOST=logstash
    -e SYSLOG_PORT=8514
    -v /etc/localtime:/etc/localtime:ro
    -v /etc/timezone:/etc/timezone:ro
    -v /var/local/PROJECTNAME/ldap:/var/lib/ldap
    -v /var/local/PROJECTNAME/slapd.d:/etc/ldap/slapd.d
    -d PROJECTNAME/slapd-PROJECTNAME:x.x.x.x

    To create a volume, say I want to store all files for this docker project in my windows directory:

    How do I modify the -v flag lines?
    Could it be:

    -v C:MyDevelopmentsTestFolder/etc/localtime:/etc/localtime:ro
    -v C:MyDevelopmentsTestFolder/etc/timezone:/etc/timezone:ro
    -v C:MyDevelopmentsTestFolder/var/local/PROJECTNAME/ldap:/var/lib/ldap
    -v C:MyDevelopmentsTestFolder/var/local/PROJECTNAME/slapd.d:/etc/ldap/slapd.d

    Please advise.
    Thanks in advance.