Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
6 views2 pages

Experiment 6 Docker Commands

Uploaded by

kusujanakiram5
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views2 pages

Experiment 6 Docker Commands

Uploaded by

kusujanakiram5
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

EXPERIMENT NO: 6

DATE:

Aim:
Explore Docker commands for content management.

Description:
Docker is an open-source containerization platform that allows developers to build,
package, and run applications in isolated environments called containers. It ensures that
applications run consistently across different computing environments, eliminating
compatibility issues.

Commands and Explanations:


 • docker --version

→ Displays the installed Docker version to confirm Docker is installed correctly.

 • docker pull hello-world

→ Downloads the 'hello-world' image from Docker Hub to test Docker setup.

 • docker run hello-world

→ Runs the hello-world container to verify Docker is functioning.

 • docker run -d -p 8080:80 nginx

→ Runs the nginx web server in detached mode with port mapping (8080:80).

 • docker pull ubuntu

→ Pulls the Ubuntu OS image to run Linux-based containers.

 • docker images

→ Lists all Docker images stored locally.

 • docker rmi -f hello-world

→ Force removes the 'hello-world' image from the local system.

 • docker ps
→ Displays only the currently running containers.

 • docker ps -a

→ Shows all containers, including stopped ones.

 • docker image ls

→ Lists all local Docker images (same as 'docker images').

 • docker inspect image nginx

→ Displays detailed configuration and layer info about the nginx image.

 • docker restart a2a8ef430f9b

→ Restarts a container using its container ID.

 • docker stop web-container

→ Stops a running container named 'web-container'.

 • docker run -d -p 9090:8080 --name my_container nginx

→ Runs nginx in the background with port mapping and a custom name.

 • docker rm -f my_container

→ Forcefully removes a container named 'my_container'.

 • docker build -t flask-app .

→ Builds a Docker image named 'flask-app' from the current directory.

 • docker run -p 5000:5000 flask-app

→ Runs the 'flask-app' image and maps port 5000 to the host.

You might also like