Docker. dotcloud PaaS Français. Mars 2013 OpenSource. Ecrit en GO



Similar documents
Intro to Docker for CMS

Platform as a Service and Container Clouds

Intro to Docker and Containers

Linux & Docker auf Azure

Repris de : Version Debian (de base)

General Certificate of Education Advanced Level Examination June 2012

Introduction au BIM. ESEB Seyssinet-Pariset Economie de la construction contact@eseb.fr

Linstantiation of applications. Docker accelerate

Saruman Documentation

Windows et Office XP, pack en 2 volumes : Microsoft Office 2003 KillerTips; Décrasser Windows X

Putting It All Together. Vagrant Drush Version Control

Docker Containers. Marko Ambrož, Žiga Hudolin Ministrstvo za javno upravo DIREKTORAT ZA INFORMATIKO

Configuration des pré-requis Linux. Référence : Version N : 1 Créé le : 9 Janvier Créé par : Thibault Cuisy Téléphone :

Hours: The hours for the class are divided between practicum and in-class activities. The dates and hours are as follows:

Enterprise Risk Management & Board members. GUBERNA Alumni Event June 19 th 2014 Prepared by Gaëtan LEFEVRE

ESMA REGISTERS OJ/26/06/2012-PROC/2012/004. Questions/ Answers

Note concernant votre accord de souscription au service «Trusted Certificate Service» (TCS)

Working with Docker on Microsoft Azure

OS9 UNIX help man chd cd del rm copy cp makdir mkdir OS9 is case sensitive!! attr chmod deldir rmdir pd pwd list more

Langages Orientés Objet Java

How Bigtop Leveraged Docker for Build Automation and One-Click Hadoop Provisioning

Administrer les solutions Citrix XenApp et XenDesktop 7.6 CXD-203

N1 Grid Service Provisioning System 5.0 User s Guide for the Linux Plug-In

Solaris 10 Documentation README

Survey on Conference Services provided by the United Nations Office at Geneva

Introduction ToIP/Asterisk Quelques applications Trixbox/FOP Autres distributions Conclusion. Asterisk et la ToIP. Projet tuteuré

Mise en pratique : installation d'openvpn sur OpenWRT

Personnalisez votre intérieur avec les revêtements imprimés ALYOS design

Scrubbing Disks Using the Solaris Operating Environment Format Program

Thursday, February 7, DOM via PHP

Upgrading the Solaris PC NetLink Software

Tool & Asset Manager 2.0. User's guide 2015

POB-JAVA Documentation

What Does Tequila Have to Do with Managing Macs? Using Open Source Tools to Manage Mac OS in the Enterprise!

Audit de sécurité avec Backtrack 5

SunFDDI 6.0 on the Sun Enterprise Server

Jimmy Hébergement Cloud - TechDay

Sun Cluster 2.2 7/00 Data Services Update: Apache Web Server

Installation. Installation centreon + nagios mai LISTE DES PRE-REQUIS. Nagios/centreon Paquets divers. 1.1.

Interfaces de programmation pour les composants de la solution LiveCycle ES (juillet 2008)

AgroMarketDay. Research Application Summary pp: Abstract

Stockage distribué sous Linux

EPREUVE D EXPRESSION ORALE. SAVOIR et SAVOIR-FAIRE

How To Set Up Vsftpd On A Pc Or Mac Or Mac (For Mac) On A Mac Or Ipa (For Pc Or Ipad) On Pc Or Pc Or Pb (For Ipa) On An Ipa Or Mac

Technical Service Bulletin

TP : Configuration de routeurs CISCO

Sun Management Center Change Manager Release Notes

Sun Management Center 3.5 Update 1b Release Notes

Qu est-ce que le Cloud? Quels sont ses points forts? Pourquoi l'adopter? Hugues De Pra Data Center Lead Cisco Belgium & Luxemburg

Installation troubleshooting guide

Docker : devops, shared registries, HPC and emerging use cases. François Moreews & Olivier Sallou

Calcul parallèle avec R

Level 2 French, 2014

Installation GENTOO + RAID sur VMWARE

Archived Content. Contenu archivé

Monitoring Open Source pour Java avec JmxTrans, Graphite et Nagios

ATP Co C pyr y ight 2013 B l B ue C o C at S y S s y tems I nc. All R i R ghts R e R serve v d. 1

Command Line Crash Course For Unix


User Manual of the Pre-built Ubuntu 9 Virutal Machine

Group Projects M1 - Cubbyhole

Short Form Description / Sommaire: Carrying on a prescribed activity without or contrary to a licence

Office of the Auditor General / Bureau du vérificateur général FOLLOW-UP TO THE 2010 AUDIT OF COMPRESSED WORK WEEK AGREEMENTS 2012 SUIVI DE LA

Sun StorEdge A5000 Installation Guide

Optimizing Solaris Resources Through Load Balancing

BILL C-665 PROJET DE LOI C-665 C-665 C-665 HOUSE OF COMMONS OF CANADA CHAMBRE DES COMMUNES DU CANADA

Introduction to Git. Markus Kötter Notes. Leinelab Workshop July 28, 2015

Les Métiers (Jobs and Professions)

Chris Rosen, Technical Product Manager for IBM Containers, Lin Sun, Senior Software Engineer for IBM Containers,

Modifier le texte d'un élément d'un feuillet, en le spécifiant par son numéro d'index:

PRMS.

Sun StorEdge RAID Manager Release Notes

State of Maryland Health Insurance Exchange

ref. 6 Young 2G Accès d angle à 2 portes pivotantes / Corner entry enclosure, 2 hinged doors

Docker on OpenStack. August Author : Nitin Agarwal nitinagarwal3006@gmail.com. Supervisor(s) : Belmiro Moreira

APPLICATION NOTE. How to build pylon applications for ARM

Git - Working with Remote Repositories

Liste d'adresses URL

You can choose to install the plugin through Magento Connect or by directly using the archive files.

Sun StorEdge N8400 Filer Release Notes

Covert Channels inside DNS

CDH installation & Application Test Report

Product / Produit Description Duration /Days Total / Total

CPE111 COMPUTER EXPLORATION

Solaris 9 9/05 Installation Roadmap

How To Install Project Photon On Vsphere 5.5 & 6.0 (Vmware Vspher) With Docker (Virtual) On Linux (Amd64) On A Ubuntu Vspheon Vspheres 5.4

Using Docker in Cloud Networks

Student installation of TinyOS

Cyber security strategies, services and CyberSOC organizations. How can you deal with cyber-attacks?

Sun Enterprise Optional Power Sequencer Installation Guide

Transcription:

Docker dotcloud PaaS Français Mars 2013 OpenSource Ecrit en GO

Vocabulaire : Image vs Container Container = 1 instance d une Image. IMAGE to CONTAINER => run CONTAINER to IMAGE => build

Vocabulaire : Local vs Repo Tout fonctionne comme GIT (commit, push, pull) - REPO IMAGE to LOCAL IMAGE => pull - CONTAINER to LOCAL IMAGE => commit - LOCAL IMAGE -> REPO IMAGE => push Tout à un ID Tout à une version (on commit la différence)

Container VS Virtual Machine Docker VS VMWare, VirtualBox,.. Performance (pas de virtualisation) Isolation (namespace, cgroup) OS + Application (build complet) Plus simple que LXT (linux container), Libvirt

Avantage user Time from dev to prod (image, container) Size (diff image Git, Debian 89Mb!) Mount shared folder (host-container) Network (NAT) Communication inter-container (security)

Install sur MAC download virtualbox vagrant boot2docker boot2docker ip l ip de la vm (nécessaire pour PAT) docker version sanity check boot2docker init crée une VM (login docker, tcuser ) boot2docker start export DOCKER_HOST=tcp://192.168.59.103:2376 export DOCKER_CERT_PATH=/Users/pa/.boot2docker/certs/boot2docker-vm export DOCKER_TLS_VERIFY=1 boot2docker stop boot2docker download boot2docker start mise à jour

Install sur Ubuntu apt-get install docker

RUN sans daemon, sans terminal docker run hello-world hello-world est ici une image docker run learn/tutorial /bin/echo hello world docker run learn/tutorial apt-get install -y ping run fait un pull si besoin docker ps docker non stoppé, daemon docker ps -l last, dernier container en cours docker ps -a tous les containers docker inspect id info bas niveau du container docker images list des images en local docker images docker rmi hello-world docker rmi learn/tutorial docker images supprime image en local docker ps -a docker rm id docker ps -a supprime le container

RUN sans daemon, avec terminal docker run -t -i ubuntu:14.04 /bin/bash charge l image ubuntu:14.04 instancie l image passe en mode interactif (autrement pas d output des commandes) branche un terminal tty (sinon pas très user friendly) execute /bin/bash exit (ctrl+d), sans -t pas de teminal sans -i pas interactif, passer en mode interactif

RUN en mode daemon docker run -d ubuntu:14.04 /bin/sh -c "while true; do echo hello world; sleep 1; done" passer en mode daemon return un containerid docker logs namecontainer ou id docker logs -f namecontainer ou id docker stop namecontainer ou id stop mais ne détruit pas docker restart namecontainer ou id relance la commande

Tips : --name Simplifier vous la vie docker run -t -i --name essaiubuntu ubuntu:14.04 /bin/bash

CONTAINER avec PAT docker run -d -P training/webapp python app.py -P forward le port sur le host mais on ne le chosit pas docker ps -a aficher le port docker run -d -p 5000:5000 training/webapp python app.py -p forward le port, message si port déjà pris docker port id 5000 pour connaitre le port boot2docker ip http://192.168.59.103:49156/ docker logs -f id si on refait un call du web, on voit les logs monter docker top namecontainer ou id docker inspect namecontainer ou id docker inspect -f '{{.NetworkSettings.IPAddress }}' namecontainer ou id docker restart

Attach Container docker run -d -P --name web training/webapp python app.py docker exec -i -t web bash :) Toujours pas compris à quoi sert la fonction attach : docker attach web

HUB docker images liste images déjà ramenées https://registry.hub.docker.com/ chercher sinatra https://registry.hub.docker.com/u/training/sinatra/ docker search training/sinatra si pas de / alors image officiel docker, normalement le user docker pull training/sinatra ramene l image pour info docker run fait le docker pull si besoin docker images https://registry.hub.docker.com/_/golang/ docker pull golang:1.3.2 on verra plus tard l utilité de ce docker docker login pour se connecter au hub docker, créé un fichier.dockercfg more ~pa/.dockercfg!! docker mais à disposition un container pour faire son repo étrange il est écrit en python :) L image s appelle registry https://registry.hub.docker. com/_/registry/

Commit to repository docker run -t -i training/sinatra /bin/bash gem install json touch onearchi exit docker ps -l docker diff pensive_torvalds docker commit -m="added json gem" -a="pa" d68820a0d5a0 patrickalin/sinatra:v2 id peut être les 3 premiers caractères, retourne l id de l image docker images docker run -t -i patrickalin/sinatra:v2 /bin/bash ls onearchi exit docker push patrickalin/sinatra:v2 https://registry.hub.docker.com/repos/ docker rmi patrickalin/sinatra:v2 supprimer l image que l on vient de créer

Save image/container to file docker images docker save image_id > image.tar docker rmi image_id docker load image_id < image.tar docker ps -a docker export container_id > container.tar docker rm container_id cat container.tar docker import - container_id le container devient une image!

Build from Dockerfile mkdir sinatra cd sinatra touch Dockerfile # This is a comment FROM ubuntu:14.04 MAINTAINER Patrick ALin <patrickalin@gmail.com> RUN touch OneArchi2.txt docker build -t="patrickalin/sinatra:v3". attention le. à la fin :) docker images docker run -t -i patrickalin/sinatra:v3 /bin/bash ls -> on voit notre fichier onearchi2 docker images docker tag 0cf901cc6927 patrickalin/sinatra:v4 changer le tag docker images

Example : NGINX

Network suite docker run -d -p 5000:5000 training/webapp python app.py bind fix docker run -d -p 127.0.0.1:5000:5000 training/webapp python app.py bind to interface du host docker run -d -p 127.0.0.1::5000 training/webapp python app.py docker choisi dynamiquement docker run -d -p 127.0.0.1:5000:5000/udp training/webapp python app.py UDP docker port id 5000 list du bind

Container linking : App with DB docker run -d --name db training/postgres docker run -d -P --name web --link db:webdb training/webapp python app.py --link name:alias docker ps --no-trunc awk '{print $NF}' voir les liens link docker exec -ti web /bin/bash Add Environment variables : env, Updating the /etc/hosts file. WEBDB_PORT_5432_TCP=tcp://172.17.0.18:5432 WEBDB_PORT=tcp://172.17.0.18:5432 WEBDB_PORT_5432_TCP_PORT=5432 WEBDB_PORT_5432_TCP_ADDR=172.17.0.18 172.17.0.18 webdb The connection will be secure and private; only the linked web container will be able to talk to the dbcontainer.

Data inter container Mount Example migration, partage de disque entre 2 containers docker run -d -v /dbdata --name db1 training/postgres -v crée le volume dbdata docker exec -i -t db1 bash (répertoire vide, touch onearchi2) docker run -d --name db2 --volumes-from db1 training/postgres volumes-from monte le volume docker exec -i -t db2 bash Mount volume from host Example backup docker run --volumes-from db1 -v $(pwd)/backup:/backup ubuntu tar cvf /backup/backup.tar /dbdata -v host:container

Ex: cross compile GO https://registry.hub.docker.com/_/golang/ sur le host créer un fichier hello.go docker run --rm -it -v "$(pwd)":/usr/src/myfolder -w /usr/src/myfolder golang:1.3.1-cross bash --rm écrase le container si il existe déjà -v monter le folder du host dans le container à /myapp -w move to this folder (work directory) exécue go build -v comme si on était sur le host cross build docker run --rm -v "$(pwd)":/myapp -w /myapp golang:1.3.1 go build -v docker run --rm -v "$(pwd)":/myapp -w /myapp -e GOOS=windows -e GOARCH=386 golang:1.3.2-cross go build -v docker run --rm -v "$(pwd)":/usr/src/myapp -w /usr/src/myapp -e GOOS=darwin -e GOARCH=amd64 golang:1.3.1-cross go build -v -e environment

Example : Clustering Cluster de nginx modifier créer un fichier index.html dans le répertoire html docker run --name data-volume-container -v $PWD/html:/usr/share/nginx/html debian:jessie /bin/bash docker run --name static1 -d -p 80 --volumes-from data-volume-container nginx /usr/sbin/nginx -g "daemon off;" docker run --name static2 -d -p 80 --volumes-from data-volume-container nginx /usr/sbin/nginx -g "daemon off;" docker port static1 80 boot2docker ip http://ip :49159 docker port static2 80 http://ip :49159

Docker UI docker run -d -p 9000:9000 -v /var/run/docker.sock:/docker.sock crosbymichael/dockerui -e /docker.sock

Autres commandes docker image -a voir tout l history docker history image:tag voir le comment docker stop $(docker ps -a -q) docker rm $(docker ps -a -q) supprimer tous les containers docker info où est-ce stocké docker events ce qui se passe en temps réel docker start, pause, unpause, stop start pour se rattacher, les autres comme le nom l indique Et bien d autres...

Others examples docker run --name mysql -e MYSQL_ROOT_PASSWORD=mysecretpassword -d mysql docker run --name="phpmyadmin" -d -P --link mysql:mysql --env=virtual_host=phpmyadmin.example.com maxexcloo/phpmyadmin docker port phpmyadmin docker run -d -P --name php -v "$(pwd)":/var/www/html --link mysql:mysql php:5.6-apache.

Si on stop la VM est-ce que l on a la reprise de docker Shipyard