Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Docker: The basics - Including a demo with an a...

Docker: The basics - Including a demo with an awesome full-stack JS app

What is Docker?
What is Jquery, MongoDB and Nashorn?
The high-level architecture of the Online Kanban Board
Docker run syntax / putting everything together
What is Docker-Compose and why it is so amazing
DEMO

Avatar for Marcelo R Costa

Marcelo R Costa

May 27, 2016
Tweet

Other Decks in Technology

Transcript

  1. Docker: The basics Marcelo Costa Cloud Integration Engineer, Connections Cloud

    @themarcelor May 2016 Including a demo with an awesome full-stack JS app
  2. Agenda • What is Docker? • What is Jquery, MongoDB

    and Nashorn? • The high-level architecture of the Online Kanban Board • Docker run syntax / putting everything together • What is Docker-Compose and why it is so amazing • DEMO • Q & A
  3. Docker run syntax / putting everything together 1/2 The basics:

    • docker run -it busybox:latest • docker run -d busybox:latest top c646318a53cd4e16780cd654fa6df854c6550e089491f4a805ba16edd3b94c32 • docker attach c646 • ctrl+c stops the container (ssh if you need to jump into containers without impacting → them) • Some important parameters: Parameters Configuration -d (detached) Runs in detached mode (not interactive) --name Name of the container (ID) -h (Hostname) Hostname within Docker Network --link Allow communication within Docker Network -p (Port) Exposed port (host:container) -v (Volume) Mapped Volume/disk/path (host:container) <image> Name of the image (parent obj of the container) -w (Working Dir) Initial directory/folder for container commands
  4. Docker run syntax / putting everything together 2/2 • Adding

    some complexity: • docker run -d --name mydbcontainer -h mykanbandbhost -p 27017:27017 -v /home/marcelo/.docker-volumes/myOnlineKanban/data:/data/db mongo • docker run -d --name mykanban -h mykanbanapp --link mydbcontainer -p 8080:8080 -w /opt/mykanban -v /home/marcelo/Projects/MyOnlineKanban/mykanban:/opt/mykanban java:8 /usr/bin/jjs -cp lib/mongo-2.10.1.jar httpsrv.js Listing running containers: • docker ps --filter status=running CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 4c97e0fca863 busybox:latest "top" 3 seconds ago Up 2 seconds stupefied_euclid
  5. What is Docker-Compose and why it is so amazing •

    Instead of executing multiple “docker run” commands or opening multiple terminals to start and track each container configuration, use a single command:  Docker-compose up • Docker-compose.yml mykanban: image: java:8 working_dir: /opt/mykanban/ command: jjs -cp lib/mongo-2.10.1.jar httpsrv.js links: - mydbcontainer ports: - '8080:8080' volumes: - ~/Projects/MyOnlineKanban/mykanban:/opt/mykanban mydbcontainer: image: mongo environment: MONGODB_USER: mongouser MONGODB_PASSWORD: meh123 hostname: mykanbandbhost ports: - '27017:27017' volumes: - ~/.docker- volumes/myOnlineKanban/data:/data/db/