Docker publish port | Docker expose port from container | Port configuration in docker container

Опубликовано: 11 Март 2026
на канале: Devops Learning
426
4

In this video you will see about docker images, docker container and docker port publish. Watch this complete video you will see how container mapped on a port. Will show you how we can publish a port in docker container.

Follow below commands for docker port publish.

Command for Publish 80 Port:
1. docker images
2. docker run -td --name apacheserver -p 80:80 ubuntu
3. docker port apacheserver
4. docker exec -it apacheserver /bin/bash
5. apt-get update
6. apt-get install apache2 -y
7. cd /var/www/html/
8. service apache2 start

Command for Publish 8080 Port:
1. docker run -td --name cicdserver -p 8080:8080 jenkins/jenkins
2. docker port cicdserver
3. docker exec -it cicdserver /bin/bash