Docker Example Ubuntu

Docker allows us to install any operating system in an isolated container. Here, we are installing Ubuntu in Docker.

1. Take ubuntu image pull from docker hub.

sudo docker pull ubuntu

 ubuntu image

2. List down the Images

sudo docker images  

docker images list

3. Now run the container using this image

sudo docker run -it -d ubuntu

container using this image

4. List down the running containers

sudo docker ps

list of running container

5. Enter in running container

sudo docker exec -it <container-id > /bin/bash

existing container

6. To exit from container without killing it press CTRL+P CTRL+Q

Subscribe Now