Skip to content

Docker training

Christine Tranchant-Dubreuil edited this page Apr 25, 2017 · 24 revisions

Module 1 : Introduction Docker

build

  • Workflows Developer : production et compilation image (DEV)
  • outil : Docker toolbox

pour Mac et windows (pas demon natif comme sous linux), permet de faire tourner le demon docker qui va tourner dans une machine virtuelle linux (virtual box) <-> engine docker <=> docker for Mac and Windows now : add url)

  • Se compose de :

Docker Engine Docker Compose Docker Swarm (partie cluster) Docker Client Kitematic : outil graphique (pas intéressant)

ship

  • registry services: transport et stockage des images produites pendant la phase de dev
  • outil :

** Docker Hub ** <=> "github" docker = plateforme mutualisée en ligne de reference https://hub.docker.com/ stocke image sous cloud ou sur son propre réseau/registry

** Docker Trusted Registry ** avec interface (commerciale) --> interface web --> gestion utilisateur avec accès

** Docker Registry open source ** version gratuite sans interface

run

en envt dev ou prod : gestion des dockers

  • ** docker cloud ** (plateforme en ligne payante ) qui permet de deployer les conteners crées
  • ** docker Universal Control Plane ** / Docker data center

deploiement sur cloud, vm ou hybrides

Rq : toutes ces couches s appuient sur le Docker Engine

===> mettre image


Module 2 :

Docker Engine

  • Program that enables containers to be distribued and run
  • Several natives fonctionalities
  • keys :

NAMESPACES : isolation ps et syst fichiers CGROUPS : mesurer et limiter utilisation ressources + donner accès à des periphériques Regles IPTABLES : communication entre containers sur meme hote + comm entre containers et exterieur

  • Archi client / server

  • Docker Containers and Images

  • Registry and repository image

  • Docker orchestration

3 outils

  • Docker Machine : provisionne hotes dockers et installer Docker engine dessus
  • Docker Compose : pour creer et gerer applications multi containers
  • Docker Engine swarm mode : pour creer des clusters dans la version Engine facilement en 3 commandes

Module 3 : Installation Docker

Docker Engine

  • on linux : url / cf dia
  • on mac (> yosemite) / window (>)
  • community edition / entreprise edition

Module 4 : Introduction image

Module 5 : Running and Managing containers

Practical

ubuntu 16.03

Checking Client and Daemon version

Run

root@ird-6-0:~# docker version
Client:
 Version:      17.04.0-ce
 API version:  1.28
 Go version:   go1.7.5
 Git commit:   4845c56
 Built:        Mon Apr  3 18:07:42 2017
 OS/Arch:      linux/amd64

Server:
 Version:      17.04.0-ce
 API version:  1.28 (minimum version 1.12)
 Go version:   go1.7.5
 Git commit:   4845c56
 Built:        Mon Apr  3 18:07:42 2017
 OS/Arch:      linux/amd64
 Experimental: false

Searching for images

docker search

root@ird-6-0:~# docker search java
NAME                   DESCRIPTION                                     STARS     OFFICIAL   AUTOMATED
java                   Java is a concurrent, class-based, and obj...   1351      [OK]       
anapsix/alpine-java    Oracle Java 8 (and 7) with GLIBC 2.23 over...   203                  [OK]
isuper/java-oracle     This repository contains all java releases...   53                   [OK]
lwieske/java-8         Oracle Java 8 Container - Full + Slim - Ba...   33                   [OK]
nimmis/java-centos     This is docker images of CentOS 7 with dif...   25                   [OK]
ibmjava                Official IBM® SDK, Java™ Technology Editio...   24        [OK]       
nimmis/alpine-java     This is docker images of Alpine 3.5 with d...   10                   [OK]
nimmis/java            This is docker images of Ubuntu 14.04 LTS ...   10                   [OK]
1science/java          Java Docker images based on Alpine Linux        6                    [OK]
cardcorp/r-java        Minimal R environment with Java for hadoop...   6                    [OK]
andreluiznsilva/java   Docker images for java applications             4                    [OK]
blacklabelops/java     Oracle Java Base Images. Alpine and CentOS...   4                    [OK]
frekele/java           docker run --rm --name java frekele/java        4                    [OK]
tsuru/java             Image for the Java (OpenJDK) platform in t...   1                    [OK]
dwolla/java            Dwolla’s custom Java image                      1                    [OK]
beevelop/java          Personal Java image based on Ubuntu 15.10 ...   1                    [OK]
infotechsoft/java      Java on CentOS                                  0                    [OK]
konstruktoid/java      Java base image                                 0                    [OK]
instructure/java       A java base image based on instructure/core     0                    [OK]
synopsis/java          Docker image with Java                          0                    [OK]
anduin/java            Anduin Java base image                          0                    [OK]
vicamo/java                                                            0                    [OK]
bigtruedata/java       Base image for java applications                0                    [OK]
esycat/java            Oracle Java 8 on Ubuntu LTS                     0                    [OK]
axeclbr/java           Java on Alpinelinux in Docker.                  0                    [OK]

Displays images installed locally

root@ird-6-0:~# docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE

Pulling images

root@ird-6-0:~# docker pull ubuntu / ubuntu:12.04
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
root@ird-6-0:~# docker pull busybox
Using default tag: latest
latest: Pulling from library/busybox
7520415ce762: Pull complete 
Digest: sha256:32f093055929dbc23dec4d03e09dfe971f5973a9ca5cf059cbfb644c206aa83f
Status: Downloaded newer image for busybox:latest
root@ird-6-0:~# docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
busybox             latest              00f017a8c2a6        6 weeks ago         1.11MB

Running and Managing containers

docker run [options] [image] [command] [args]

#pull image si on l a pas (cli)
root@ird-6-0:~# docker run ubuntu:14.04 echo "Hello world"
Unable to find image 'ubuntu:14.04' locally
14.04: Pulling from library/ubuntu
8f229c550c2e: Pull complete 
8e1fb71e8df6: Pull complete 
f75a34586856: Pull complete 
8744e322b832: Pull complete 
d5165bfce78f: Pull complete 
Digest: sha256:edf05697d8ea17028a69726b4b450ad48da8b29884cd640fec950c904bfb50ce
Status: Downloaded newer image for ubuntu:14.04
Hello world
root@ird-6-0:~# 
root@ird-6-0:~# docker run ubuntu:14.04 ps -ef
UID        PID  PPID  C STIME TTY          TIME CMD
root         1     0  0 10:44 ?        00:00:00 ps -ef

Docker Engine

blablabla

blabla

Url

https://hub.docker.com/

Clone this wiki locally