Skip to content

yehezkiel1086/docker-k8s-stuffs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

62 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Docker Docs

Docker notes, small projects, and solutions from several sources.

Table of Contents

What is Docker?

What is a Container?

  • A way to package application with all the necessary dependencies and configurations
  • Portable artifact, easily shared and moved around
  • Makes development and deployment more efficient.
  • Layers of images
  • Mostly Linux Base Image, bc small in size
  • Application image on top

Containers live in container repositories:

  • Private repositories
  • Public repository for Docker (e.g: DockerHub)

Before vs After Containers

Before Containers

  • Installation process different on each OS environment
  • Many steps where something could go wrong
  • Configuration on server needed: Dependency version conflicts
  • Textual guide of deployment: Misunderstandings

After Containers

  • Own isolated environment (based on lightweight linux)
  • Packaged with all needed configuration
  • One command to install the app
  • Run same app with 2 different versions
  • Developers and Operations work together to package the application in a container
  • No environmental configuration needed on server (except Docker Runtime)

Docker Image vs Container:

  • Image:
    • The actual package
    • Artifact, that can be moved around
  • Container:
    • Actually start the application
    • Container environment is created

Docker vs Virtual Machine

The difference lies on what parts of the operating system they virtualize:

  • Docker virtualizes the Applications layer
  • Virtual Machines virtualizes the OS Kernel and the Applications layer

This means:

  • Size: The size of Docker images are much smaller (couple of MB)
  • Speed: Docker containers start and run much fast
  • Compatibility: VM of any OS can run on any OS host -- Docker can't do this, a workaround is installing a technology called Docker Toolbox which abstracts away the Kernel

What is Docker?

Docker is a set of platform as a service (PaaS) products that use OS-level virtualization to deliver software in packages called containers. - Wikipedia

From the above definition, basically, Docker consists of three things:

  1. A set of Platform as a Service (PaaS)
  2. Docker uses OS-level virtualization
  3. For delivery of software in packages called containers

Docker Architecture: Docker Diagram

Most Common Commands

Command Explanation Shorthand
docker image ls Lists all images docker images
docker image rm [image] Removes an image docker rmi
docker image pull [image] Pulls image from a docker registry docker pull
docker container ls Lists running containers docker ps
docker container ls -a Lists all containers docker ps -a
docker container run [image] Runs a container from an image docker run [image]
docker container rm [container] Removes a container docker rm [container]
docker container stop [container] Stops a container docker stop [container]
docker container exec [container] Executes a command inside the container docker exec [container]

Sources

About

๐Ÿ“– Docker and k8s notes, scripts, small projects and solutions

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published