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

Docker Workshop

Rafael Dutra
September 20, 2018

Docker Workshop

Introdução de como iniciar com containers Docker.

- Comandos básicos
- Dockerfile
- Gerenciamento de containers
- Rodando uma "aplicação" em CLI (Command Line Interface) com PHP
- Docker Compose

Rafael Dutra

September 20, 2018
Tweet

More Decks by Rafael Dutra

Other Decks in Programming

Transcript

  1. WHO AM I? • Rafael Dutra • SysAdmin and DevOps

    Enthusiast • Security Information - UNISINOS 2008 - ? • Linux user since 2005 • Docker user since 2015 • PHP (Laravel)/Shell/Ruby
  2. WORKING WITH/AT Vagrant, Puppet, Terraform, Continuous Integration, Continuous Deployment, Shell

    Scripting, Docker, AWS (learning) ... Shared Services Ops Team @crossover - https://crossover.com @jivesoftware - https://jivesoftware.com @aurea - https://www.aurea.com
  3. AGENDA • What’s Docker? • Container vs Virtual Machine •

    Why should I use Docker? • Terminology • Images and Layers • Containers and Layers • Dockerfile anatomy
  4. WHAT'S DOCKER? • Open Source technology • Agility, accelerate software

    development and deployment • Portability, eliminate the "works on my machine" • Container is not Virtual Machine
  5. WHY SHOULD I USE DOCKER? • Infrastructure as Code -

    IAC • All application is an image • Works on my machine, no more! • Set up locally the same environment that you have in production, or any other environment • Tests, a lot of them • Community
  6. TERMINOLOGY • Images = is our “how it was built”

    / what we want to run • Containers = runs images in a dynamic way. By dynamic I meant: multiple containers can run the same image doing different things. • Volumes = where we want to store our data, could be our physical directory or a docker volume
  7. DOCKERFILE # base image FROM nginx # copy a file

    to a specific directory COPY index.html /usr/share/nginx/html # running the application CMD ["nginx", "-g", "daemon off;"]
  8. HANDS ON AGENDA • Docker installation • The basics, running

    containers • Interacting with containers • Dockerfile • Using volumes • Docker Compose
  9. DOCKER BASICS Running our first web container docker run --detach

    --publish 45000:80 nginx • action that we want to do • options to detach (run it in background) and publish ports • port that we want to access in our machine • port running in the container • image we are using at this moment
  10. RUN FORREST … RUN WITH MATH <?php $val1 = 60;

    $val2 = 20; echo "Soma de ${val1} + ${val2} igual a: " . ($val1 + $val2) . "\n"; Lets create a file called: soma.php