SlideShare a Scribd company logo
WORKSHOP
Rafael Dutra - FOSS Day Lajeado 2018
@raffaeldutra - Lajeado/RS
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
WORKING WITH/AT
Vagrant, Puppet, 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
AGENDA
● What’s Docker?
● Container vs Virtual Machine
● Why should I use Docker?
● Terminology
● Images and Layers
● Containers and Layers
● Dockerfile anatomy
WHAT'S DOCKER?
● Open Source technology
● Agility, accelerate software development and
deployment
● Portability, eliminate the "works on my machine"
● Container is not Virtual Machine
CONTAINER VS VIRTUAL MACHINES
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
TERMINOLOGY
● Images = is our “how it was built” / what we want to
run it
● 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
IMAGES AND LAYERS
CONTAINERS AND LAYERS
DOCKERFILE
# imagem base
FROM nginx
# copiando arquivo para um diretório específico
COPY index.html /usr/share/nginx/html
# rodando aplicação
CMD ["nginx", "-g", "daemon off;"]
HANDS ON
HANDS ON AGENDA
● Docker installation
● The basics, running containers
● Interacting with containers
● Dockerfile
● Using volumes
● Docker Compose
DOCKER INSTALLATION
● Ubuntu: https://goo.gl/YFDkpv
● Debian: https://goo.gl/T6pmJd
DOCKER BASICS
Full commands
docker
DOCKER BASICS
Need a medic? ask for help
docker <command> --help
DOCKER BASICS
Running our first container
docker run alpine hostname
DOCKER BASICS
Running our second container
docker run hello-world
DOCKER BASICS
Everything comes from an image
docker run alpine hostname
DOCKER BASICS
To list all images
docker image ls
DOCKER BASICS
To search an image
docker search alpine
DOCKER BASICS
To remove an image
docker image rm alpine
DOCKER BASICS
To pull (download) an image
docker image pull ubuntu
DOCKER BASICS
To pull (download) an specific image version
docker image pull ubuntu:17.10
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
MANIPULATE CONTAINERS
To list running containers
docker container ls
MANIPULATE CONTAINERS
To list all containers
docker container ls -a
MANIPULATE CONTAINERS
Stopping a container
docker container stop <id>
MANIPULATE CONTAINERS
Starting a container
docker container start <id>
MANIPULATE CONTAINERS
Interacting with them
docker run --interactive --tty ubuntu /bin/bash
MANIPULATE CONTAINERS
Executing …. something without enter in a container
docker exec <id> <command>
MANIPULATE CONTAINERS
Attaching
docker attach <id>
CREATING IMAGES
FROM php:7.2.5-cli-alpine3.7
CMD ["php", "--version"]
CREATING IMAGES
docker build --tag fossday/php:7.2 .
RUN FORREST … RUN
docker run --rm fossday/php:7.2
RUN FORREST … RUN
docker run --rm fossday/php:7.2 --help
RUN FORREST … RUN WITH MATH
<?php
$val1 = 60;
$val2 = 20;
echo "Soma de ${val1} + ${val2} igual a: " .
($val1 + $val2) . "n";
RUN FORREST … RUN
docker run --rm 
-v $(pwd)/soma.php:/root/soma.php 
fossday/php:7.2 
php -f /root/soma.php
CLEANING
Remove all images that we’re not using (dangling)
docker image prune
CLEANING
Remove all containers that are in stopped state (dangling)
docker container prune
DOCKER COMPOSE
● Orchestrate containers
● YAML
● Single file: docker-compose.yaml
● Multi containers
DOCKER COMPOSE
docker-compose up -d
QUESTIONS ?
HERE WE GO
GET IN TOUCH
http://rafaeldutra.me
https://linkedin.com/in/rafaeldutra
@raffaeldutra
raffaeldutra@gmail.com
https://github.com/raffaeldutra
https://www.slideshare.net/raffaeldutra
THANK YOU
SEE YOU LATER

More Related Content

PDF
Docker Workshop Birthday #3
Jirayut Nimsaeng
 
PDF
Docker and Running multiple versions of PHP @ CareerZoo Dublin
rjsmelo
 
PPTX
Docker session III: Dockerfile
Degendra Sivakoti
 
PPTX
Docker session II: Introduction to Docker
Degendra Sivakoti
 
PDF
Exploring Docker at Gilt
Gilt Tech Talks
 
PDF
Docker off the grid
Mirantis IT Russia
 
PDF
The world of Containers with Podman, Buildah, Skopeo by Seema - CCDays
CodeOps Technologies LLP
 
PPSX
From Zero to Hero - Nexinto
Johann Paulus Almeida
 
Docker Workshop Birthday #3
Jirayut Nimsaeng
 
Docker and Running multiple versions of PHP @ CareerZoo Dublin
rjsmelo
 
Docker session III: Dockerfile
Degendra Sivakoti
 
Docker session II: Introduction to Docker
Degendra Sivakoti
 
Exploring Docker at Gilt
Gilt Tech Talks
 
Docker off the grid
Mirantis IT Russia
 
The world of Containers with Podman, Buildah, Skopeo by Seema - CCDays
CodeOps Technologies LLP
 
From Zero to Hero - Nexinto
Johann Paulus Almeida
 

What's hot (15)

PDF
Arquitecturas de microservicios - Codemotion 2014
Ernesto Hernández Rodríguez
 
PDF
Sep Nasiri "Upwork PHP Architecture"
Fwdays
 
PDF
Docker Up and Running Introduction
Mark Beacom
 
PDF
Docker Barcelona Meetup - An Introduction to BuildKit
Arnaud Porterie
 
PDF
Scaling Docker Registry
Mirantis IT Russia
 
PDF
OSDC 2017 - Dr. Udo Seidel - VMwares (open source) Way of Container
NETWAYS
 
PDF
Workshop - Golang language
Vincent Composieux
 
PDF
Vagrant: The ability to create production environments from day 1 of development
Paul Stack
 
PPTX
Portainer dublin 11_2017
Anthony Lapenna
 
PDF
[HKOSCON][20200613][ Ansible: From VM to Kubernetes]
Wong Hoi Sing Edison
 
PDF
Docker 101 - From production to development
Raül Pérez
 
PDF
Paris Container Day 2016 : Cloud de conteneurs, conteneurs dans le cloud, str...
Publicis Sapient Engineering
 
PDF
[Szjug] Docker. Does it matter for java developer?
Izzet Mustafaiev
 
PDF
VN Tech Seminor Vol.2 Docker Tutorial
Shuhei Yamashita
 
PDF
Super powered Drupal development with docker
Maciej Lukianski
 
Arquitecturas de microservicios - Codemotion 2014
Ernesto Hernández Rodríguez
 
Sep Nasiri "Upwork PHP Architecture"
Fwdays
 
Docker Up and Running Introduction
Mark Beacom
 
Docker Barcelona Meetup - An Introduction to BuildKit
Arnaud Porterie
 
Scaling Docker Registry
Mirantis IT Russia
 
OSDC 2017 - Dr. Udo Seidel - VMwares (open source) Way of Container
NETWAYS
 
Workshop - Golang language
Vincent Composieux
 
Vagrant: The ability to create production environments from day 1 of development
Paul Stack
 
Portainer dublin 11_2017
Anthony Lapenna
 
[HKOSCON][20200613][ Ansible: From VM to Kubernetes]
Wong Hoi Sing Edison
 
Docker 101 - From production to development
Raül Pérez
 
Paris Container Day 2016 : Cloud de conteneurs, conteneurs dans le cloud, str...
Publicis Sapient Engineering
 
[Szjug] Docker. Does it matter for java developer?
Izzet Mustafaiev
 
VN Tech Seminor Vol.2 Docker Tutorial
Shuhei Yamashita
 
Super powered Drupal development with docker
Maciej Lukianski
 
Ad

Similar to Docker workshop (20)

PDF
Docker
Brian Hogan
 
PPTX
Getting Started with Docker
Geeta Vinnakota
 
PPTX
Containerization using docker and its applications
Puneet Kumar Bhatia (MBA, ITIL V3 Certified)
 
PPTX
Containerization using docker and its applications
Puneet Kumar Bhatia (MBA, ITIL V3 Certified)
 
PPTX
Docker Introductory workshop
Runcy Oommen
 
PDF
Docker From Scratch
Giacomo Vacca
 
PDF
Work shop - an introduction to the docker ecosystem
João Pedro Harbs
 
PDF
Docker Essentials Workshop— Innovation Labs July 2020
CloudHero
 
PPTX
Docker
Hussien Elhannan
 
PDF
Agile Brown Bag - Vagrant & Docker: Introduction
Agile Partner S.A.
 
PDF
A Gentle Introduction to Docker and Containers
Docker, Inc.
 
PPTX
Getting started with Docker
Ravindu Fernando
 
PDF
Docker 101 Workshop slides (JavaOne 2017)
Eric Smalling
 
PPTX
Docker advance1
Gourav Varma
 
PDF
Docker 0.11 at MaxCDN meetup in Los Angeles
Jérôme Petazzoni
 
PPTX
Java Developer Intro to Environment Management with Vagrant, Puppet, and Dock...
Lucas Jellema
 
PDF
codemotion-docker-2014
Carlo Bonamico
 
PDF
Introduction to Docker at Glidewell Laboratories in Orange County
Jérôme Petazzoni
 
PDF
Dockercon 23 - Getting started with Docker
ssuserfb6acb
 
Docker
Brian Hogan
 
Getting Started with Docker
Geeta Vinnakota
 
Containerization using docker and its applications
Puneet Kumar Bhatia (MBA, ITIL V3 Certified)
 
Containerization using docker and its applications
Puneet Kumar Bhatia (MBA, ITIL V3 Certified)
 
Docker Introductory workshop
Runcy Oommen
 
Docker From Scratch
Giacomo Vacca
 
Work shop - an introduction to the docker ecosystem
João Pedro Harbs
 
Docker Essentials Workshop— Innovation Labs July 2020
CloudHero
 
Agile Brown Bag - Vagrant & Docker: Introduction
Agile Partner S.A.
 
A Gentle Introduction to Docker and Containers
Docker, Inc.
 
Getting started with Docker
Ravindu Fernando
 
Docker 101 Workshop slides (JavaOne 2017)
Eric Smalling
 
Docker advance1
Gourav Varma
 
Docker 0.11 at MaxCDN meetup in Los Angeles
Jérôme Petazzoni
 
Java Developer Intro to Environment Management with Vagrant, Puppet, and Dock...
Lucas Jellema
 
codemotion-docker-2014
Carlo Bonamico
 
Introduction to Docker at Glidewell Laboratories in Orange County
Jérôme Petazzoni
 
Dockercon 23 - Getting started with Docker
ssuserfb6acb
 
Ad

Recently uploaded (20)

PDF
Get More from Fiori Automation - What’s New, What Works, and What’s Next.pdf
Precisely
 
PPTX
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
PDF
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
PDF
Doc9.....................................
SofiaCollazos
 
PPTX
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
PDF
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
PDF
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
PDF
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
PDF
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
PDF
How ETL Control Logic Keeps Your Pipelines Safe and Reliable.pdf
Stryv Solutions Pvt. Ltd.
 
PPTX
IT Runs Better with ThousandEyes AI-driven Assurance
ThousandEyes
 
PDF
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
PDF
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
PDF
AI-Cloud-Business-Management-Platforms-The-Key-to-Efficiency-Growth.pdf
Artjoker Software Development Company
 
PPTX
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
PPTX
Agile Chennai 18-19 July 2025 | Emerging patterns in Agentic AI by Bharani Su...
AgileNetwork
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PDF
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
PDF
The Future of Artificial Intelligence (AI)
Mukul
 
PDF
Peak of Data & AI Encore - Real-Time Insights & Scalable Editing with ArcGIS
Safe Software
 
Get More from Fiori Automation - What’s New, What Works, and What’s Next.pdf
Precisely
 
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
Doc9.....................................
SofiaCollazos
 
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
How ETL Control Logic Keeps Your Pipelines Safe and Reliable.pdf
Stryv Solutions Pvt. Ltd.
 
IT Runs Better with ThousandEyes AI-driven Assurance
ThousandEyes
 
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
AI-Cloud-Business-Management-Platforms-The-Key-to-Efficiency-Growth.pdf
Artjoker Software Development Company
 
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
Agile Chennai 18-19 July 2025 | Emerging patterns in Agentic AI by Bharani Su...
AgileNetwork
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
The Future of Artificial Intelligence (AI)
Mukul
 
Peak of Data & AI Encore - Real-Time Insights & Scalable Editing with ArcGIS
Safe Software
 

Docker workshop