To check which port is being used by a particular container: #DOCKER INSPECT FORMAT GO TEMPLATE INSTALL# To check the IP address of the container named proxy:ĭocker container inspect –format ‘’ proxy the above command will show the IP of the virtual network of the container. Note: the above command will use the default driver bridge.Ĭreate a network when creating a container: You cannot have two containers on the same port on the host level. #docker container exec –it my_nginx ping new_nginxĭocker image tagging and push it to the image hub To ping from a container named new_nginx to another container my_nignx, use the following command: To add the existing container to the new network my-app-net:ĭocker network connect id-of-network id-of-container # docker container run -d -name nginx1 - network my-app-net nginxĬheck the my-app-net to see that nginx1 is now using my-app-netĭocker network rm my-app-net ( or use the id) #DOCKER INSPECT FORMAT GO TEMPLATE DRIVER# The tags are labels that point to the actual docker image ID. You can create you own docker file and create own custom image. #docker image tag nginx securitywing/nginx Also, you can retag the existing docker image. Note: here securitywing is the docker user name and nginx is the image name. #DOCKER INSPECT FORMAT GO TEMPLATE FULL#.#DOCKER INSPECT FORMAT GO TEMPLATE DRIVER#.#DOCKER INSPECT FORMAT GO TEMPLATE INSTALL#.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |