# Create a Docker Container from a Docker Image

In 
Published 2022-12-03

This tutorial explains to you how we can create a Docker container from a Docker image. This tutorial has an example as well.

If you want to create a Docker container on which you want to deploy something, you need to have a Docker image. A Docker image is a template used to create and launch a Docker container. A Docker image can contain a simple Linux installation or fully-configured enterprise software install, ready to run. In order to understand better how Docker is working, you can take a look at the article named What is Docker .

Containers are instances of Docker images that can be run using the Docker run command:

In this case, I create a new instance of "centos" image which run in an interactive mode (the "-i" option).

From this picture you can see that:

  • a Docker container has an unique ID
  • a Docker container has a hostname and an IP
  • a Docker container could be a network element

Another things good to know about Docker containers:

  • you can deploy applications on these containers
  • you can define networks and attach containers to these networks
  • these containers can communicate between them
  • the containers can communicate with the host
  • you can set hardware consumption for each container