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 provides you container shell immediately.
docker run -it centos
Also try our customized Ubuntu docker image with ssh access enabled in our docker hub repository.
sudo docker run -d -p 2222:22 tecadmin/ubuntu-ssh:16.04
List Docker Containers
Use docker ps command to list all running containers on your current system. This will not list stopped containers. This will show you the Container ID, name and other use full information about the container.
docker ps -a
Find all Details of Container
Use docker inspect command to find all details about a docker container. You need to provide container id or container name to get details of the specific container.
docker inspect cc5d74cf8250
Delete Docker Container
Use docker rm command to delete existing docker container. You need to provide container id or container name to delete specific container.
docker stop cc5d74cf8250 docker rm cc5d74cf8250