Saturday, 18 April 2020

Dockers and Containers

For years, developer had a challenge setting up development environment with the right configurations of tools as well as time required for the same.

This becomes even more complex when developer is using diverse technology stack. Consider a scenario where developer has written code in Python to accept the web requests using Mongo DB as back-end and further using analytics application to generate report.

Now as you can see diverse technology stack comes into picture here, is it easy task to setup all these stacks and connect with each others? Not at all. That's where docker technology comes into picture.

Above problem for installing the required technology tools/stack becomes very handy just with few commands! Rest you rely on the docker to take care of back-end dependencies.

  1. docker run  --name=db -d mongo   (This will install complete running Mongo DB for you )
  2. docker run --name=db -d MySQL  (This will install complete running MySQL DB for you )
  3. docker run  --name=db -d nginix   (This will install complete running NGINX for you )
Its that easy! Of course we can mention additional configurations by parameters, you can refer respective docker documentation for the same.

By Default when container is started, IP address is allocated within the sub net range defined for bridge network.

First we can list the interfaces as mentioned below : 

docker network ls

For viewing the details of default IP range configured we can use following command,

docker network inspect bridge

Now we know the default range allocated for container. We can list the IP address of running container by executing following command

docker container inspect --format '{{ .NetworkSettings.IPAddress }}' <container name>

List docker container processes running on system along with their details

docker ps

1 comment:

  1. Keep sharing such amazing blogs. Our Penetration Testing firm offers professional cyber security consulting services. Hire cyber security professionals today!
    penetration testing