Docker

Udemy Course Material

$ git clone https://github.com/BretFisher/udemy-docker-mastery.git

// later on to have an update: go in the project repo
$ git pull

Community Links:

Setup Docker

Setup Docker on Rasperry Pi

To install docker on Raspberry pi: https://phoenixnap.com/kb/docker-on-raspberry-pi

!!! Docker image on compatible with Raspberry pi4 must be ARM64 in the Docker hub site (check on left side the parameters arm64)

Opposed to most other Linux distributions, Raspberry Pi is based on ARM architecture. Hence, not all Docker images will work on your Raspberry Pi.

In fact, all Docker images that are not specifically designed for ARM devices will not work. Running docker-apps designed for x86/x64 and i386 architecture on your Raspberry Pi will return an error.

  • Install docker compose on pi

Setup Docker on Linux

Docker was made to run on Linux native (unbuntu)

Instruction to install docker on Linux: https://docs.docker.com/engine/install/ubuntu/

! if you are on Linux REHL (Redhat enterprise edition), it supports only the docker enterprise version

But Linux Centos Version support Docker CE

There is an all in one script to install docker from script doing all, check OS type

!! Docker-machine and docker-compose are not installed by default with the command here above (which is the case with MAC, so you will need to install them manually

Setup docker on MAC

Setup on Mac: https://www.docker.com/products/docker-desktop

You can also download the edge version on : https://docs.docker.com/docker-for-mac/edge-release-notes/

On Mac docker app, they support both stable and edge version, via settings it is easy to jump from one to another

Docker doesn't live natively on Mac Kernel, so we need to have a Linux VM running on MAC.

A nice bash terminal for Mac is: https://iterm2.com

Install docker bash auto completion: https://docs.docker.com/docker-for-mac/#install-shell-completion

You can make nice color on tuned termina: https://www.bretfisher.com/shell/

Docker Theory Concepts

Docker Software type

Docker CE = Community Edition = free version

Docker EE = Enterprise Edition = paid, support included and ony available on certified machine

3 different types of installation:

  • Direct

  • Win/Mac => not supported so there is a some VM install where docker run inside of it = legacy docker toolbox (you have a GUI, app)

  • Cloud: Azure, AWS, Google

Version available:

  • Edge = beta version, once every month

  • Stable, once per quarter

Images vs container:

  • Image: application we want to run -> so just code

  • container: instance of the image running as a process

Registry = docker hub = repo of all the docker prebuild docker images (like the repo on github) -> https://hub.docker.com

docker container run "ContainerName:Version" --> what behind the wood

  • look locally in image cash if there is a container with that name

  • if no image locally, then go automatically to Docker Hub

  • If you don't specify a version, it takes as default, the last one: nginx:latest

  • Then create a new container based on that image

  • Prepare start:

    • give container a virtual IP on private network inside the docker engine

    • Then open port mapping specified in the --publish options. If that option is not defined, no port will be opened between hosting PC and docker engine

  • Then Start the container using the commands defined in the DockerFile

Docker Commands

COmmands to know: https://towardsdatascience.com/15-docker-commands-you-should-know-970ea5203421

Learning Docker by steps

Check Setup

Start a NGINX Web Server

Last updated

Was this helpful?