A repository containing a short tutorial for Docker (with Python).

Overview

Docker Tutorial for IFT 6758 Lab

image

In this repository, we examine the advtanges of virtualization, what Docker is and how we can deploy simple programs on Docker.

Firstly, we will start by listing some advantages of virtualization. We can discuss them as follows:

  • Minimize hardware costs (Multiple virtual servers on one hardware unit).
  • Easily for HA (High Availability) And Disaster Recovery (DR).
  • Easier to save money and save energy, could be potentially greener.

Problems with Virtualization:

  • Hard to maintain each OS, installation, HyperVisor and host OS compatibility issues, and HyperVisor - container issues.
  • Costly and might take IT/Programming effort.
  • We might need a high storage overhead, even lightweight OSs with all tools installed can bulk up to a high size.

image

Solution?

  • Use containers!

Container definition:

  • is a runnable instance (or sandbox) of an image.
  • can be run on local machines, virtual machines or deployed to the cloud.
  • is portable (can be run on any OS).
  • Containers are isolated from each other and run their own software, binaries, and configurations.

Methodology:

  • These applications share a parent application and its overhead.
  • These apps can run separately, and we can avoid multithreading issues, deadlock issues and other issues with RPCs that may arise.
  • They can't access each other's resources, and they are like apartments in a complex.

Container Architecture:

image

  • Multiple containers run on the same machine virtual / physical machine.
  • All containers share the same OS and Kernel.
  • We can micro-manage processes, and have a higher level and more fine-grained access.
  • We can stop processes using the power of the host OS, and we can even save/move states as we need.
  • We can run containers inside VM! It's interesting as we can combine the power of both if we have a very specialized applicaiton.
  • Higher security as we are working with a very simple isolated block of code.

Compute Comparision:

image

Docker:

Standard definition:

"An open-source project that automates the deployment of software applications inside containers by providing an additional layer of abstraction and automation of OS-level virtualization on Linux."

image

  • Does exactly what we need, and it assists in efficient containerization.
  • Free and Open Source! (now under Moby)
  • Helps in packaing source code, libraries, dependencies, volumes, routes, etc for production.
  • The name Docker had roots from the word "Dock Worker", assists in effective container management.
  • Containers are built from images and saved as images.
  • Each image is identified by a UUID/256 Bit Hash.
  • Each Docker Image has several tags, and we can help in effective versioning.
  • Dockers can be secured by SSH, and additional network security techniques.

image

image

Dockerfile:

  • Dictates the program installation, setup, packaging, instructions, port exposition, etc.
  • We can run a container, list a container, version them, delete them, etc.

Sample Docker Image (for getting started):

docker run -d -p 80:80 docker/getting-started

Tools:

  • Docker Compose: It us used for maintaining and running multi-container Docker applications. We use YAML (mark-up) to dictate the format, dependencies and other nuances of a project. It can aid in building and scaling containers.
  • Docker Volume: We can store and manage separate volumes of code, that avoid deletion when the container is stopped.

Glossary:

  • Docker Daemon: The background service running on the host that manages building, running and distributing Docker containers. The daemon is the process that runs in the operating system which clients talk to.
  • Docker Client: The command line tool that allows the user to interact with the daemon. More generally, there can be other forms of clients too - such as Kitematic which provide a GUI to the users.
  • Docker Hub: A registry of Docker images. You can think of the registry as a directory of all available Docker images. If required, one can host their own Docker registries and can use them for pulling images.
  • Docker Container Image: When running a container, it uses an isolated filesystem. This custom filesystem is provided by a container image. Since the image contains the container's filesystem, it must contain everything needed to run an application - all dependencies, configuration, scripts, binaries, and so on. The image also contains other configuration for the container, such as environment variables, a default command to run, and other metadata.

Folder instructions:

  • Tutorial 1: Demonstrates a basic Docker program.
  • Tutorial 2: Demonstrates simple Redis counter example with compose.
  • Tutorial 3: Docker + NGINX Reverse Proxy + Vanilla MongoDB/NoSQL.
  • Tutorial 4: Same as Tutorial 1, but updated WSGI (Web Server Gateway Interface), instead of a default Flask development WSGI.

References:

  1. https://runnable.com/docker/python/docker-compose-with-flask-apps
  2. https://github.com/docker/awesome-compose
  3. https://docs.docker.com/language/python/build-images/
  4. https://www.cse.wustl.edu/~jain/cse570-18/ftp/m_21cdk.pdf
  5. https://en.wikipedia.org/wiki/Docker_(software)
  6. https://docs.docker.com/compose/
  7. https://docker-curriculum.com/
Owner
Arka Mukherjee
Master's Student in ML and CS @ Mila, University of Montreal
Arka Mukherjee
Phonebook application to manage phone numbers

PhoneBook Phonebook application to manage phone numbers. How to Use run main.py python file. python3 main.py Links Download Source Code: Click Here M

Mohammad Dori 3 Jul 15, 2022
DC/OS - The Datacenter Operating System

DC/OS - The Datacenter Operating System The easiest way to run microservices, big data, and containers in production. What is DC/OS? Like traditional

DC/OS 2.3k Jan 06, 2023
This project shows how to serve an TF based image classification model as a web service with TFServing, Docker, and Kubernetes(GKE).

Deploying ML models with CPU based TFServing, Docker, and Kubernetes By: Chansung Park and Sayak Paul This project shows how to serve a TensorFlow ima

Chansung Park 104 Dec 28, 2022
A lobby boy will create a VPS server when you need one, and destroy it after using it.

Lobbyboy What is a lobby boy? A lobby boy is completely invisible, yet always in sight. A lobby boy remembers what people hate. A lobby boy anticipate

226 Dec 29, 2022
Run Oracle on Kubernetes with El Carro

El Carro is a new project that offers a way to run Oracle databases in Kubernetes as a portable, open source, community driven, no vendor lock-in container orchestration system. El Carro provides a p

Google Cloud Platform 205 Dec 30, 2022
Changelog CI is a GitHub Action that enables a project to automatically generate changelogs

What is Changelog CI? Changelog CI is a GitHub Action that enables a project to automatically generate changelogs. Changelog CI can be triggered on pu

Maksudul Haque 106 Dec 25, 2022
Tiny Git is a simplified version of Git with only the basic functionalities to gain better understanding of git internals.

Tiny Git is a simplified version of Git with only the basic functionalities to gain better understanding of git internals. Implemented Functi

Ahmed Ayman 2 Oct 15, 2021
HB Case Study

HB Case Study Envoy Proxy It is a modern Layer7(App) and Layer3(TCP) proxy Incredibly modernized version of reverse proxies like NGINX, HAProxy It is

Ilker Ispir 1 Oct 22, 2021
🎡 Build Python wheels for all the platforms on CI with minimal configuration.

cibuildwheel Documentation Python wheels are great. Building them across Mac, Linux, Windows, on multiple versions of Python, is not. cibuildwheel is

Python Packaging Authority 1.3k Jan 02, 2023
Ganeti is a virtual machine cluster management tool built on top of existing virtualization technologies such as Xen or KVM and other open source software.

Ganeti 3.0 =========== For installation instructions, read the INSTALL and the doc/install.rst files. For a brief introduction, read the ganeti(7) m

395 Jan 04, 2023
Dynamic DNS service

About nsupdate.info https://nsupdate.info is a free dynamic DNS service. nsupdate.info is also the name of the software used to implement it. If you l

nsupdate.info development 880 Jan 04, 2023
This is a tool to develop, build and test PHP extensions in Docker containers.

Develop, Build and Test PHP Extensions This is a tool to develop, build and test PHP extensions in Docker containers. Installation Clone this reposito

Suora GmbH 10 Oct 22, 2022
Convenient tool to manage multiple VMs at once using libvirt

Convenient tool to manage multiple VMs at once using libvirt Installing To install the tool and its dependencies: pip install -e . Getting completion

Cedric Bosdonnat 13 Nov 11, 2022
A basic instruction for Kubernetes setup and understanding.

A basic instruction for Kubernetes setup and understanding Module ID Module Guide - Install Kubernetes Cluster k8s-install 3 Docker Core Technology mo

648 Jan 02, 2023
MicroK8s is a small, fast, single-package Kubernetes for developers, IoT and edge.

MicroK8s The smallest, fastest Kubernetes Single-package fully conformant lightweight Kubernetes that works on 42 flavours of Linux. Perfect for: Deve

Ubuntu 7.1k Jan 08, 2023
Wiremind Kubernetes helper

Wiremind Kubernetes helper This Python library is a high-level set of Kubernetes Helpers allowing either to manage individual standard Kubernetes cont

Wiremind 3 Oct 09, 2021
Kubediff: a tool for Kubernetes to show differences between running state and version controlled configuration.

Kubediff: a tool for Kubernetes to show differences between running state and version controlled configuration.

Weaveworks 1.1k Dec 30, 2022
Hubble - Network, Service & Security Observability for Kubernetes using eBPF

Network, Service & Security Observability for Kubernetes What is Hubble? Getting Started Features Service Dependency Graph Metrics & Monitoring Flow V

Cilium 2.4k Jan 04, 2023
ZeroMQ bindings for Twisted

Twisted bindings for 0MQ Introduction txZMQ allows to integrate easily ØMQ sockets into Twisted event loop (reactor). txZMQ supports both CPython and

Andrey Smirnov 149 Dec 08, 2022
A charmed operator for running PGbouncer on kubernetes.

operator-template Description TODO: Describe your charm in a few paragraphs of Markdown Usage TODO: Provide high-level usage, such as required config

Canonical 1 Dec 01, 2022