Containers, Docker

What is a Container

  • OS Level Virtualization

  • Small Executable executable code , Lightweight

  • Portable and Platform Independent

  • Improve Utilization of Hardware more efficient than VM

Common Docker Commands

  • Give Tag

  • Build Image

  • Images Command

  • Run a Container

  • Push and Pull Commands

(Alternative Rocket is used compared to Docker)

  • Docker file is the blueprint for an image

  • Image is an Immutable file that contains everything necessary to run an application

  • Images are read only , Writeable Layer is placed on top to write files

  • Layers can be shared between images which can save disk space and network bandwidth

Dockerfile Instructions

  • From : Define Base Images (OS)

  • Run : execute code

  • ENV : set environment variables

  • ADD and COPY : copy files and directories

  • CMD : define the default command for the execution of the container , there can be only one command in case there are many only the last one will be executed

Container Registry

  • Distribution of named container images

  • PUSH , PULL registry

Image Naming

  • hostname/repository:tag

  • tag can be version number of OS version etc

Running Containers

Deleting Docker

Docker Command Sheet

Troubleshooting and Monitoring Containers

Docker CheatSheet

Container Orchestration

  • manage lifecycle of containers ,in dynamic environments

  • using Kubernetes

Kubernetes Architecture

Labels / Selectors and Namespace in Cluster

Pod in Cluster

  • Wrapper for a Single Container

  • Replica set for Horizontal Scaling

  • specified using YAML file

Imperative Commands

Declarative Commands

  • Apply Command

  • Use the kubectl CLI

  • Create a Kubernetes Pod

  • Create a Kubernetes Deployment

  • Create a ReplicaSet that maintains a set number of replicas

  • Witness Kubernetes load balancing in action

Managing Applications with Kubernetes

Openshift Architecture

Source to Image

Build Triggers

Istio

Cloud Native computing Foundation

Redhat Openshift (Code snippets)

  • Use the oc CLI

  • Use the OpenShift web console

  • Build and deploy an application using s2i

  • Inspect a BuildConfig and an ImageStream

Reference

Last updated

Was this helpful?