First steps to a new development workflow
Guilhem Marty (@le_pixel)
1001pharmacies.com
@1001pharmaDev
Virtual Machines
OS
Host Machine
Hypervisor
Guest OS Guest OS Guest OS Guest OS
App 1 App 2 App 2’ App 3
DB DB AMPQ
Bins/Libs Bins/Libs Bin...
LXC
OS
Host Machine
Docker
App 1 App 2 App 2’ App 3
Bins/Libs Bins/LibsBins/Libs
[Yem@home]-[/var/www] $ docker pull debian:wheezy
[Yem@home]-[/var/www] $ docker run -i -t debian:wheezy /bin/bash
root@e3...
FROM debian:wheezy
Dockerfile
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update 
&& apt-get install -y 
apache2 
php5 ...
Build & Run
[Yem@home]-[/var/www] $ docker build -t app ./
[Yem@home]-[/var/www] $ docker images
REPOSITORY TAG IMAGE ID C...
[Yem@home]-[/var/www] $ docker run -d -P 
--name app-db 
-e "MYSQL_ROOT_PASSWORD=root" 
mariadb:10
Run a database
[Yem@home]-[/var/www] $ docker run -d -P 
--name app-db 
-e "MYSQL_ROOT_PASSWORD=root" 
mariadb:10
Link containers 1/2
[Ye...
Link containers 2/2
root@55d016720713:/# cat /etc/hosts
172.17.0.4 55d016720713
127.0.0.1 localhost
::1 localhost ip6-loca...
Questions ?
First steps to docker
First steps to docker
First steps to docker
First steps to docker
First steps to docker
First steps to docker
Prochain SlideShare
Chargement dans…5
×

First steps to docker

998 vues

Publié le

First steps to a Docker development workflow. And how we moved from Vagrant to Docker.

Publié dans : Technologie
0 commentaire
1 j’aime
Statistiques
Remarques
  • Soyez le premier à commenter

Aucun téléchargement
Vues
Nombre de vues
998
Sur SlideShare
0
Issues des intégrations
0
Intégrations
47
Actions
Partages
0
Téléchargements
11
Commentaires
0
J’aime
1
Intégrations 0
Aucune incorporation

Aucune remarque pour cette diapositive

First steps to docker

  1. 1. First steps to a new development workflow Guilhem Marty (@le_pixel) 1001pharmacies.com @1001pharmaDev
  2. 2. Virtual Machines
  3. 3. OS Host Machine Hypervisor Guest OS Guest OS Guest OS Guest OS App 1 App 2 App 2’ App 3 DB DB AMPQ Bins/Libs Bins/Libs Bins/LibsBins/Libs
  4. 4. LXC
  5. 5. OS Host Machine Docker App 1 App 2 App 2’ App 3 Bins/Libs Bins/LibsBins/Libs
  6. 6. [Yem@home]-[/var/www] $ docker pull debian:wheezy [Yem@home]-[/var/www] $ docker run -i -t debian:wheezy /bin/bash root@e3cfb271ab6e:/# Run a container [Yem@home]-[/var/www] $ docker images REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE debian wheezy 1265e16d0c28 2 days ago 84.98 MB
  7. 7. FROM debian:wheezy Dockerfile ENV DEBIAN_FRONTEND noninteractive RUN apt-get update && apt-get install -y apache2 php5 mysql-client EXPOSE 80 CMD ./usr/sbin/apache2ctl -D FOREGROUND
  8. 8. Build & Run [Yem@home]-[/var/www] $ docker build -t app ./ [Yem@home]-[/var/www] $ docker images REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE app latest 98a0cc8f6e58 6 seconds ago 169.9 MB debian wheezy 1265e16d0c28 2 days ago 84.98 MB [Yem@home]-[/var/www] $ docker run -d -P app 2c7082ee3b572d0743c0f09ecbab8a27a9a6ab70d354f901dc781feb1c835d21 [Yem@home]-[/var/www] $ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 9330f7f0947d app:latest "./usr/sbin/apache2c 15 minutes ago Up 15 minutes 0.0.0.0:49153->3306/tcp clever_feynman
  9. 9. [Yem@home]-[/var/www] $ docker run -d -P --name app-db -e "MYSQL_ROOT_PASSWORD=root" mariadb:10 Run a database
  10. 10. [Yem@home]-[/var/www] $ docker run -d -P --name app-db -e "MYSQL_ROOT_PASSWORD=root" mariadb:10 Link containers 1/2 [Yem@home]-[/var/www] $ docker run -d -P --name app-web --link app-db:db app /bin/bash
  11. 11. Link containers 2/2 root@55d016720713:/# cat /etc/hosts 172.17.0.4 55d016720713 127.0.0.1 localhost ::1 localhost ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters 172.17.0.2 db root@55d016720713:/# mysql -u root -proot -h db -e "SHOW DATABASES;" +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | +--------------------+
  12. 12. Questions ?

×