Hello Friends ,
Today we are going to learn some basic commands of Docker Network.
Docker Network Commands
List of Available network
docker network ls // Show the list of network
Create new Network
docker network create –driver [driver-name] [network-name]
Example : docker network create –driver bridge my_network
If the option ādriver is not given then the network will be created as a bridge network. Else, the specified driver will be used.
Provides details for the given Docker network.
docker network inspect [network-name|network id]
example : docker network inspect my_network
Filter in inspect command. Ex. want to see the only container info
docker network inspect -f ‘{{.Containers}}’ my_network // this command will give the information of only container running on
my_network
Remove the given Docker network.
docker network rm [network-name|network id]
Disconnects the given container to the specified network.
docker network disconnect [network-name|network id] [container-name|Container ID]
Create the container on Specific network
docker container run -d –name [container_name] –network [network_id|network_name] [imageId|image_name]
example : docker container run -d –name nginx_container –network my_network nginx
Docker Network DNS
DNS stands for Domain Name System.
DNS makes it possible for us to use easy to remember domain names in place of complex IP addresses.
Containers uses DNS to communicate. Containers donāt use IP address to Communicate.
Example . Ping Nginx container from another container
Step 1: launch 2 nginx container
docker run -d –name nginx_01 –network my_netwrork nginx
docker run -d –name nginx_02 –network my_netwrork nginx
Step 2: Login to Nginx server and install ping command
docker exec -it nginx_01 /bin/bash // After executing this command you are login into nginx and execute below command
apt-get update
apt-get install inetutils-ping
Step 3: ping nginx_02 from nginx_01
docker exec -it nginx_01 ping nginx_02
Reference :
https://github.com/Abhishek08/Docker
YOUTUBE PLAYLIST
https://www.youtube.com/channel/UCTPgiUhMnzTFVUJUswxhWJQ?view_as=subscriber
#devops #devopsvideos #devopstutorial #jenkins #jenkinsvideos
#jenkinstutorial #docker #dockertutorial #devopsprojects
#devopsrealtime #devopshandson
#devopspracticals
#cicd #jenkinspipeline #pipeline
#devopstraining
#DockerImages #DockerContainers #DockerTutorials #DockerTraining #DevOpsTools #DevOpsTraining #DockerCommands #DockerForBeginners #DockerFreeTutorials #DockerforDevOps#Docker2020 #DockerTutorial2020#createcustomimage
source
What a great tutorial in short time
Perfect explanation š
You are on the roll
Sir,
You really did do outdid yourself with this one…
Loved the precise and apposite explanation.
Useful information šš»
Sir
Again thnks for annthore great video
Yuor, s explanation way an manereee are awesom
Helpfulll an knowledge gainble your, s video sir
Thnks and pressure
Lovely way of you're
Wating for next video
Nicely explained.
Great video!
Nice video
Grt
šš
Superb…
Vry useful information sir.. It's to easy learn..
Very helpful š
Awesome video…š
Awesome video. Easy to understand.
We want videos every dayš¤š¤