DEV Community

Khalil Chaymae
Khalil Chaymae

Posted on

Create a container using the Ubuntu image in Docker.

This post explains how to create a container for an Ubuntu Linux distribution in Docker. It's very easy to do using simple commands.


Step 1:
Run Docker Desktop on your Windows machine.
step 2:
Open the Command Prompt (CMD) and type the following command.

docker pull ubuntu
Enter fullscreen mode Exit fullscreen mode

Image description

Step 3 :
Run the following command to create the container.

NB: If the Ubuntu image is not present on your machine:
Docker will automatically pull the Ubuntu image from Docker Hub, which is Docker's default image registry.
Once the image is downloaded, Docker will use it to create and start the container.
If the Ubuntu image is already present on your machine:
Docker will skip the pull step and directly use the existing local copy of the Ubuntu image to create and start the container.

docker run -it --name my-ubuntu-container ubuntu
Enter fullscreen mode Exit fullscreen mode

Image description

the End...

Top comments (0)