Skip to content

Network Automation

My journey with Network & Cloud Automation

Menu
  • Beginner
  • DevOps-NetDevOps
  • Network Automation
    • Docker
    • Python Libraries
      • NAPALM
      • Netmiko
      • Jinja2
      • Scrapli
      • Yang
  • Cloud Automation
    • Terraform
  • Python 🐍 Tips and Tricks
Menu
docker for network engineers

Docker for Network Engineers Part I – An Introduction

Posted on September 8, 2021September 14, 2021 by Gurpreet Kochar

As network engineers, we have seen the shift from physical hardware to virtual machines. Docker is taking the concept of virtual machines a step further and make it even better. To revisit, let’s see what is a Virtual Machine.

Virtual Machines

A hypervisor runs between base infrastructure, a physical server most of the time and allows running separate instances of guest operating systems with each guest operating system known as a virtual machine acting as an independent unit. While this allowed better utilization of hardware resources it consumed a lot of resources from the host machine to provision a guest operating system. Each VM includes a full copy of an operating system, the application, necessary binaries, and libraries – taking up tens of GBs. VMs can also be slow to boot

Let’s see what is a docker container.

Instead of having the resources consumed by multiple operating systems in the case of VMs, a docker setup will have one host operating system which runs the docker application that will serve as the abstraction layer that communicates between the Host operating system and the application containers. Multiple containers can run on the same machine and share the OS kernel with other containers, each running as isolated processes in userspace. Containers take up less space than VMs (container images are typically tens of MBs in size), can handle more applications, and require fewer VMs and Operating systems.

What is a container ?

Notice it doesn’t contain the full operating system image in the container. All it contains is the least amount of system libraries that are required to run the environment. Ubuntu for example is from its website is available at 2.6GB but it contains the GUI and a lot of applications that developers don’t need. A common ubuntu docker image will probably be 60 – 70 Mb. There are also other Linux flavors that are as little as 20Mb in size.

To bring more context to network engineers.

Imagine you wrote a device status monitoring web application on your local machine ( maybe MACOS ). That application used a lot of libraries like Flask, Pyats, MySql, and a few more. Now you want to give that application to other users. For them to be able to run that application either you need to pass the instructions to them to install all the dependencies and then run the code. This application will probably work on a user running Linux-based OS after they have done pip install the requirements but it won’t work on Windows because I know PyAts is not supported on Windows at the moment. How do you get around this problem?

If you develop your application inside a container, your container will not only contain the code of your application but it will also contain all the libraries and the base system libraries that are a bare minimum must run your application. With Docker installed on their machine, they just run the container you gave and the application will definitely run for them too because they just ran the exact same environment that you used to develop the application.

In Part II of this series, we will see some CLI action of how to work with docker.

Docker for Network Engineers Part II – Installation and Basic Usage

Know someone who may benefit? Share this:

  • Tweet
  • Click to share on Telegram (Opens in new window) Telegram
  • Click to share on WhatsApp (Opens in new window) WhatsApp
  • Click to email a link to a friend (Opens in new window) Email
  • More
  • Click to print (Opens in new window) Print
  • Click to share on Reddit (Opens in new window) Reddit
  • Share on Tumblr
  • Pocket

Like this:

Like Loading...

Related

4 thoughts on “Docker for Network Engineers Part I – An Introduction”

  1. Pingback: Netbox Docker Installation [Quick and Easy] – Network Automation
  2. Pingback: Docker for Network Engineers Part IV - What is a Dockerfile
  3. Pingback: Docker for Network Engineers Part III - Creating a custom docker image/container – Network Automation
  4. Pingback: Docker for Network Engineers Part II - Installation and Basic Usage – Network Automation

Leave a ReplyCancel reply

All Blog Posts
My Resume

Upcoming Posts

Sorry - nothing planned yet!

Recent Posts

  • How to backup configuration to TFTP Server using Ansible – Part II
  • How to backup network devices using Ansible – Part I
  • Netmiko SSH Proxy/JumpServer
  • A short note on SASE
  • Understanding Ansible

Recent Comments

  1. Jack on Multithreading with Python for Network Engineers
  2. LifeCanvas on [Theory] Multithreading vs Multiprocessing vs AsyncIO
  3. Jasper Horng on Netmiko SSH Proxy/JumpServer
  4. asdfasdf on Python API Using FASTAPI – UPDATE – PUT – PATCH – Part V
  5. Gurpreet Kochar on Python Scrapli AsyncIO Usage

Archives

  • September 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
Topic Request / Suggestion
Loading
© 2025 Network Automation | Powered by Minimalist Blog WordPress Theme
 

Loading Comments...
 

    %d