DevOps Classroom notes 02/Jul/2025

Docker Networking contd

  • By default docker container run on bridge network (default)
  • We can create our own bridge networks
  • container can be connected to network even after creation.
  • Lets create two containers d1 and d2 in default bridge network
docker run --name d1 -d alpine sleep 1d
docker run --name d2 -d alpine sleep 1d


* Now lets inspect container and find ip addresses. Try ping

* Default bridge network allows ip based resolution but not name based resolution
* Where a custom bridge network allow name based resolutions
* Lets create a custom bridge network with range 192.168.0.0/24

docker network create --driver bridge --subnet 192.168.0.0/24 learning


* NOw lets create two container l1 and l2 and try connectivty by name and ip

docker run --name l1 --network learning -d alpine sleep 1d
docker run --name l2 --network learning -d alpine sleep 1d


Nop Commerce with network

  • We have a image called as nop:1.0 which is our application and also we have pulled mysql image
  • lets create a network called as nop-net with range 10.100.0.0/24
docker network create --driver bridge --subnet 10.100.0.0/24 nop-net
  • Lets create a volume for database nop-vol
docker volume create nop-vol
  • Lets create a database container nopdb in nop-net with nop-vol attached

docker run \
  --name nopdb \
  --network nop-net \
  -e POSTGRES_USER=nop \
  -e POSTGRES_PASSWORD=qtdevops \
  -e POSTGRES_DB=nop \
  -p 5432:5432 \
  -d postgres



* Now lets create nop container in nop-net

docker container run -d \
    --name nop \
    --network nop-net \
    -p 80:5000 \
    shaikkhajaibrahim/febnop:latest
  • To be continued to show the running version

Registry

  • Registries are where we store/distribute our images
  • Popular Registries
    • Docker hub
      • Private
      • Public Registries
    • Azure Container Registy (ACR)
    • AWS Elastic Container Registry (ECR)
    • GCR
    • Jfrog/Artifactory
  • Registries will have repositories where each repo reprsents and application image which will have versions as tags.
  • Login into registy
    • docker hub docker login
  • Create a tag according to repo

Published
Categorized as Uncategorized Tagged

By continuous learner

devops & cloud enthusiastic learner

Leave a comment

Turn on JavaScript to leave a comment.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Please turn AdBlock off
Plugin for Social Media by Acurax Wordpress Design Studio
Exit mobile version
%%footer%%