SlideShare a Scribd company logo
1
• Traer una imagen remota:

$ docker pull ubuntu
• Listar imágenes del sistema:

$ docker images
2
$ docker images | grep ubuntu
registry latest a90be6e49f98 12 days ago 405.2 MB
nginx 1 1822529acbbf 12 days ago 91.75 MB
nginx 1.7 1822529acbbf 12 days ago 91.75 MB
nginx latest 1822529acbbf 12 days ago 91.75 MB
debian jessie 835c4d274060 12 days ago 122.6 MB
ubuntu utopic bf49414948ac 12 days ago 199.2 MB
3
$ docker run ubuntu cat /etc/os-release
DISTRIB_ID=Ubuntu

DISTRIB_RELEASE=14.04DISTRIB_CODENAME=trusty

DISTRIB_DESCRIPTION=“Ubuntu 14.04.1 LTS"

NAME="Ubuntu"

VERSION="14.04.1 LTS, Trusty Tahr"

ID=ubuntu

ID_LIKE=debian

PRETTY_NAME="Ubuntu 14.04.1 LTS"

VERSION_ID="14.04"

HOME_URL="http://www.ubuntu.com/"

SUPPORT_URL="http://help.ubuntu.com/"

BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
4
$ docker run -ti ubuntu bash
$ docker run -d ubuntu ping 127.0.0.1
$ docker ps
$ docker attach <container_id>
$ docker stop/start/restart <container_id>
5
$ docker pull registry.linets.cl/nginx
$ docker run -d -p 8000:80 -p 4444:443 nginx
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
7b520b223efa nginx:latest "nginx -g 'daemon of 27 seconds ago Up 22 seconds 0.0.0.0:4444->443/tcp, 0.0.0.0:8888-
>80/tcp stoic_wright
6
# Pull base image.
FROM ubuntu
# Install Nginx.
RUN 
apt-get update && 
apt-get install -y nginx && 
rm -rf /var/lib/apt/lists/* && 
echo "ndaemon off;" >> /etc/nginx/nginx.conf && 
chown -R www-data:www-data /var/lib/nginx
# Define mountable directories.
VOLUME ["/etc/nginx/sites-enabled", "/etc/nginx/certs", "/etc/nginx/conf.d", "/var/log/nginx", "/var/www/html"]
# Define working directory.
WORKDIR /etc/nginx
# Define default command.
CMD ["nginx"]
# Expose ports.
EXPOSE 80
EXPOSE 443
archivo: 00-nginx/Dockerfile
7
docker build -t meetup/nginx .
docker run -d -p :80 meetup/nginx
8
$ docker build -t supervisor .
FROM ubuntu
RUN apt-get update
RUN apt-get install -y python curl
RUN apt-get install -y supervisor
ADD supervisord.conf /etc/supervisord.conf
RUN mkdir /etc/supervisord.d
CMD ["supervisord", "-c", "/etc/supervisord.conf"]
9
archivo: 01-supervisor/Dockerfile
docker run -v <ruta absoluta>:/var/www -d --name php -p :80 php
FROM supervisor
RUN apt-get update && apt-get install nginx php5-fpm php5-gd
supervisor -y
ADD nginx.conf /etc/nginx/
ADD php-fpm.conf /etc/supervisor/conf.d/
VOLUME ["/var/www"]
EXPOSE 80
CMD ["supervisord", "-c", "/etc/supervisord.conf"]
10
docker build -t php .
11
docker pull mysql
docker pull wordpress


docker run --name mysql -e
MYSQL_ROOT_PASSWORD=mysecretpassword -e
MYSQL_DATABASE=wordpress -e MYSQL_USER=wordpress
-e MYSQL_PASSWORD=13sada123 -p :3306 -d mysql
12
docker pull wordpress
docker run --name wordpress --link mysql:mysql -p
8080:80 -d wordpress
13
14
docker pull sameersbn/postgresql:latest
docker pull sameersbn/redis:latest
docker pull sameersbn/gitlab:latest
mkdir -p ~/postgresql/data
mkdir -p ~/gitlab/data
15
docker run --name=postgresql -d -e
'DB_NAME=gitlabhq_production' -e 'DB_USER=gitlab' -e
'DB_PASS=password' -v ~/postgresql/data:/var/lib/postgresql/
postgresql
16
docker run --name=redis -d redis
17
docker run --name='gitlab' -it -d -e 'GITLAB_PORT=10080' -
e 'GITLAB_SSH_PORT=10022' -p 10022:22 -p 10080:80 --
link postgresql:postgresql --link redis:redisio gitlab
18

More Related Content

What's hot

Containerization and Docker
Containerization and DockerContainerization and Docker
Containerization and Docker
Megha Bansal
 
Docker use dockerfile
Docker use dockerfileDocker use dockerfile
Docker use dockerfile
cawamata
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
Luong Vo
 
Fun with containers: Use Ansible to build Docker images
Fun with containers: Use Ansible to build Docker imagesFun with containers: Use Ansible to build Docker images
Fun with containers: Use Ansible to build Docker images
abadger1999
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
Jeffrey Ellin
 
Docker
DockerDocker
Docker 101 for Developer
Docker 101 for DeveloperDocker 101 for Developer
Docker 101 for Developer
Sofian Hadiwijaya
 
Docker toolbox
Docker toolboxDocker toolbox
Docker toolbox
Yonghwee Kim
 
Docker get started
Docker get startedDocker get started
Docker get started
Truong LD
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to docker
Walid Ashraf
 
Introduction to Docker at SF Peninsula Software Development Meetup @Guidewire
Introduction to Docker at SF Peninsula Software Development Meetup @GuidewireIntroduction to Docker at SF Peninsula Software Development Meetup @Guidewire
Introduction to Docker at SF Peninsula Software Development Meetup @Guidewire
dotCloud
 
Dockerfile Basics | Docker workshop #2 at twitter, 2013-11-05
Dockerfile Basics | Docker workshop #2 at twitter, 2013-11-05Dockerfile Basics | Docker workshop #2 at twitter, 2013-11-05
Dockerfile Basics | Docker workshop #2 at twitter, 2013-11-05
dotCloud
 
Dockerfile Basics Workshop #1
Dockerfile Basics Workshop #1Dockerfile Basics Workshop #1
Dockerfile Basics Workshop #1Docker, Inc.
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
Kuan Yen Heng
 
docker installation and basics
docker installation and basicsdocker installation and basics
docker installation and basics
Walid Ashraf
 
Rapid Development With Docker Compose
Rapid Development With Docker ComposeRapid Development With Docker Compose
Rapid Development With Docker Compose
Justin Crown
 
Docker
DockerDocker
Docker 101 Workshop slides (JavaOne 2017)
Docker 101 Workshop slides (JavaOne 2017)Docker 101 Workshop slides (JavaOne 2017)
Docker 101 Workshop slides (JavaOne 2017)
Eric Smalling
 
Docker intro
Docker introDocker intro
Docker intro
Oleg Z
 

What's hot (20)

Containerization and Docker
Containerization and DockerContainerization and Docker
Containerization and Docker
 
Docker use dockerfile
Docker use dockerfileDocker use dockerfile
Docker use dockerfile
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
 
Fun with containers: Use Ansible to build Docker images
Fun with containers: Use Ansible to build Docker imagesFun with containers: Use Ansible to build Docker images
Fun with containers: Use Ansible to build Docker images
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
 
Docker
DockerDocker
Docker
 
Docker 101 for Developer
Docker 101 for DeveloperDocker 101 for Developer
Docker 101 for Developer
 
Docker toolbox
Docker toolboxDocker toolbox
Docker toolbox
 
Docker get started
Docker get startedDocker get started
Docker get started
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to docker
 
Introduction to Docker at SF Peninsula Software Development Meetup @Guidewire
Introduction to Docker at SF Peninsula Software Development Meetup @GuidewireIntroduction to Docker at SF Peninsula Software Development Meetup @Guidewire
Introduction to Docker at SF Peninsula Software Development Meetup @Guidewire
 
Dockerfile Basics | Docker workshop #2 at twitter, 2013-11-05
Dockerfile Basics | Docker workshop #2 at twitter, 2013-11-05Dockerfile Basics | Docker workshop #2 at twitter, 2013-11-05
Dockerfile Basics | Docker workshop #2 at twitter, 2013-11-05
 
Dockerfile Basics Workshop #1
Dockerfile Basics Workshop #1Dockerfile Basics Workshop #1
Dockerfile Basics Workshop #1
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
 
docker installation and basics
docker installation and basicsdocker installation and basics
docker installation and basics
 
Docker orchestration
Docker orchestrationDocker orchestration
Docker orchestration
 
Rapid Development With Docker Compose
Rapid Development With Docker ComposeRapid Development With Docker Compose
Rapid Development With Docker Compose
 
Docker
DockerDocker
Docker
 
Docker 101 Workshop slides (JavaOne 2017)
Docker 101 Workshop slides (JavaOne 2017)Docker 101 Workshop slides (JavaOne 2017)
Docker 101 Workshop slides (JavaOne 2017)
 
Docker intro
Docker introDocker intro
Docker intro
 

Similar to Hands-On Session Docker

Docker, c'est bonheur !
Docker, c'est bonheur !Docker, c'est bonheur !
Docker, c'est bonheur !
Alexandre Salomé
 
Docker command
Docker commandDocker command
Docker command
Eric Ahn
 
Docker practice
Docker practiceDocker practice
Docker practice
wonyong hwang
 
Docker
DockerDocker
Gebruik dezelfde Docker container voor Java applicaties tijdens ontwikkelen e...
Gebruik dezelfde Docker container voor Java applicaties tijdens ontwikkelen e...Gebruik dezelfde Docker container voor Java applicaties tijdens ontwikkelen e...
Gebruik dezelfde Docker container voor Java applicaties tijdens ontwikkelen e...
NLJUG
 
Continuous delivery with docker
Continuous delivery with dockerContinuous delivery with docker
Continuous delivery with docker
Johan Janssen
 
Использование Docker в CI / Александр Акбашев (HERE Technologies)
Использование Docker в CI / Александр Акбашев (HERE Technologies)Использование Docker в CI / Александр Акбашев (HERE Technologies)
Использование Docker в CI / Александр Акбашев (HERE Technologies)
Ontico
 
Streamline your development environment with docker
Streamline your development environment with dockerStreamline your development environment with docker
Streamline your development environment with docker
Giacomo Bagnoli
 
Docker in Action
Docker in ActionDocker in Action
Docker in Action
Alper Kanat
 
Running Docker in Development & Production (#ndcoslo 2015)
Running Docker in Development & Production (#ndcoslo 2015)Running Docker in Development & Production (#ndcoslo 2015)
Running Docker in Development & Production (#ndcoslo 2015)
Ben Hall
 
Docker by Example - Basics
Docker by Example - Basics Docker by Example - Basics
Docker by Example - Basics
CodeOps Technologies LLP
 
Running Docker in Development & Production (DevSum 2015)
Running Docker in Development & Production (DevSum 2015)Running Docker in Development & Production (DevSum 2015)
Running Docker in Development & Production (DevSum 2015)
Ben Hall
 
Docker workshop
Docker workshopDocker workshop
Docker workshopEvans Ye
 
Installing odoo v8 from github
Installing odoo v8 from githubInstalling odoo v8 from github
Installing odoo v8 from github
Antony Gitomeh
 
Docker workshop DevOpsDays Amsterdam 2014
Docker workshop DevOpsDays Amsterdam 2014Docker workshop DevOpsDays Amsterdam 2014
Docker workshop DevOpsDays Amsterdam 2014
Pini Reznik
 
2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps
2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps
2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps
Омские ИТ-субботники
 
Docker orchestration v4
Docker orchestration v4Docker orchestration v4
Docker orchestration v4
Hojin Kim
 
Puppet Camp Chicago 2014: Docker and Puppet: 1+1=3 (Intermediate)
Puppet Camp Chicago 2014: Docker and Puppet: 1+1=3 (Intermediate)Puppet Camp Chicago 2014: Docker and Puppet: 1+1=3 (Intermediate)
Puppet Camp Chicago 2014: Docker and Puppet: 1+1=3 (Intermediate)
Puppet
 
Docker for dev
Docker for devDocker for dev
Docker for dev
Yusuf Found
 
Docker and friends at Linux Days 2014 in Prague
Docker and friends at Linux Days 2014 in PragueDocker and friends at Linux Days 2014 in Prague
Docker and friends at Linux Days 2014 in Prague
tomasbart
 

Similar to Hands-On Session Docker (20)

Docker, c'est bonheur !
Docker, c'est bonheur !Docker, c'est bonheur !
Docker, c'est bonheur !
 
Docker command
Docker commandDocker command
Docker command
 
Docker practice
Docker practiceDocker practice
Docker practice
 
Docker
DockerDocker
Docker
 
Gebruik dezelfde Docker container voor Java applicaties tijdens ontwikkelen e...
Gebruik dezelfde Docker container voor Java applicaties tijdens ontwikkelen e...Gebruik dezelfde Docker container voor Java applicaties tijdens ontwikkelen e...
Gebruik dezelfde Docker container voor Java applicaties tijdens ontwikkelen e...
 
Continuous delivery with docker
Continuous delivery with dockerContinuous delivery with docker
Continuous delivery with docker
 
Использование Docker в CI / Александр Акбашев (HERE Technologies)
Использование Docker в CI / Александр Акбашев (HERE Technologies)Использование Docker в CI / Александр Акбашев (HERE Technologies)
Использование Docker в CI / Александр Акбашев (HERE Technologies)
 
Streamline your development environment with docker
Streamline your development environment with dockerStreamline your development environment with docker
Streamline your development environment with docker
 
Docker in Action
Docker in ActionDocker in Action
Docker in Action
 
Running Docker in Development & Production (#ndcoslo 2015)
Running Docker in Development & Production (#ndcoslo 2015)Running Docker in Development & Production (#ndcoslo 2015)
Running Docker in Development & Production (#ndcoslo 2015)
 
Docker by Example - Basics
Docker by Example - Basics Docker by Example - Basics
Docker by Example - Basics
 
Running Docker in Development & Production (DevSum 2015)
Running Docker in Development & Production (DevSum 2015)Running Docker in Development & Production (DevSum 2015)
Running Docker in Development & Production (DevSum 2015)
 
Docker workshop
Docker workshopDocker workshop
Docker workshop
 
Installing odoo v8 from github
Installing odoo v8 from githubInstalling odoo v8 from github
Installing odoo v8 from github
 
Docker workshop DevOpsDays Amsterdam 2014
Docker workshop DevOpsDays Amsterdam 2014Docker workshop DevOpsDays Amsterdam 2014
Docker workshop DevOpsDays Amsterdam 2014
 
2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps
2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps
2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps
 
Docker orchestration v4
Docker orchestration v4Docker orchestration v4
Docker orchestration v4
 
Puppet Camp Chicago 2014: Docker and Puppet: 1+1=3 (Intermediate)
Puppet Camp Chicago 2014: Docker and Puppet: 1+1=3 (Intermediate)Puppet Camp Chicago 2014: Docker and Puppet: 1+1=3 (Intermediate)
Puppet Camp Chicago 2014: Docker and Puppet: 1+1=3 (Intermediate)
 
Docker for dev
Docker for devDocker for dev
Docker for dev
 
Docker and friends at Linux Days 2014 in Prague
Docker and friends at Linux Days 2014 in PragueDocker and friends at Linux Days 2014 in Prague
Docker and friends at Linux Days 2014 in Prague
 

Recently uploaded

GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 

Recently uploaded (20)

GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 

Hands-On Session Docker

  • 1. 1
  • 2. • Traer una imagen remota:
 $ docker pull ubuntu • Listar imágenes del sistema:
 $ docker images 2
  • 3. $ docker images | grep ubuntu registry latest a90be6e49f98 12 days ago 405.2 MB nginx 1 1822529acbbf 12 days ago 91.75 MB nginx 1.7 1822529acbbf 12 days ago 91.75 MB nginx latest 1822529acbbf 12 days ago 91.75 MB debian jessie 835c4d274060 12 days ago 122.6 MB ubuntu utopic bf49414948ac 12 days ago 199.2 MB 3
  • 4. $ docker run ubuntu cat /etc/os-release DISTRIB_ID=Ubuntu
 DISTRIB_RELEASE=14.04DISTRIB_CODENAME=trusty
 DISTRIB_DESCRIPTION=“Ubuntu 14.04.1 LTS"
 NAME="Ubuntu"
 VERSION="14.04.1 LTS, Trusty Tahr"
 ID=ubuntu
 ID_LIKE=debian
 PRETTY_NAME="Ubuntu 14.04.1 LTS"
 VERSION_ID="14.04"
 HOME_URL="http://www.ubuntu.com/"
 SUPPORT_URL="http://help.ubuntu.com/"
 BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/" 4
  • 5. $ docker run -ti ubuntu bash $ docker run -d ubuntu ping 127.0.0.1 $ docker ps $ docker attach <container_id> $ docker stop/start/restart <container_id> 5
  • 6. $ docker pull registry.linets.cl/nginx $ docker run -d -p 8000:80 -p 4444:443 nginx $ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 7b520b223efa nginx:latest "nginx -g 'daemon of 27 seconds ago Up 22 seconds 0.0.0.0:4444->443/tcp, 0.0.0.0:8888- >80/tcp stoic_wright 6
  • 7. # Pull base image. FROM ubuntu # Install Nginx. RUN apt-get update && apt-get install -y nginx && rm -rf /var/lib/apt/lists/* && echo "ndaemon off;" >> /etc/nginx/nginx.conf && chown -R www-data:www-data /var/lib/nginx # Define mountable directories. VOLUME ["/etc/nginx/sites-enabled", "/etc/nginx/certs", "/etc/nginx/conf.d", "/var/log/nginx", "/var/www/html"] # Define working directory. WORKDIR /etc/nginx # Define default command. CMD ["nginx"] # Expose ports. EXPOSE 80 EXPOSE 443 archivo: 00-nginx/Dockerfile 7
  • 8. docker build -t meetup/nginx . docker run -d -p :80 meetup/nginx 8
  • 9. $ docker build -t supervisor . FROM ubuntu RUN apt-get update RUN apt-get install -y python curl RUN apt-get install -y supervisor ADD supervisord.conf /etc/supervisord.conf RUN mkdir /etc/supervisord.d CMD ["supervisord", "-c", "/etc/supervisord.conf"] 9 archivo: 01-supervisor/Dockerfile
  • 10. docker run -v <ruta absoluta>:/var/www -d --name php -p :80 php FROM supervisor RUN apt-get update && apt-get install nginx php5-fpm php5-gd supervisor -y ADD nginx.conf /etc/nginx/ ADD php-fpm.conf /etc/supervisor/conf.d/ VOLUME ["/var/www"] EXPOSE 80 CMD ["supervisord", "-c", "/etc/supervisord.conf"] 10 docker build -t php .
  • 11. 11
  • 12. docker pull mysql docker pull wordpress 
 docker run --name mysql -e MYSQL_ROOT_PASSWORD=mysecretpassword -e MYSQL_DATABASE=wordpress -e MYSQL_USER=wordpress -e MYSQL_PASSWORD=13sada123 -p :3306 -d mysql 12
  • 13. docker pull wordpress docker run --name wordpress --link mysql:mysql -p 8080:80 -d wordpress 13
  • 14. 14
  • 15. docker pull sameersbn/postgresql:latest docker pull sameersbn/redis:latest docker pull sameersbn/gitlab:latest mkdir -p ~/postgresql/data mkdir -p ~/gitlab/data 15
  • 16. docker run --name=postgresql -d -e 'DB_NAME=gitlabhq_production' -e 'DB_USER=gitlab' -e 'DB_PASS=password' -v ~/postgresql/data:/var/lib/postgresql/ postgresql 16
  • 17. docker run --name=redis -d redis 17
  • 18. docker run --name='gitlab' -it -d -e 'GITLAB_PORT=10080' - e 'GITLAB_SSH_PORT=10022' -p 10022:22 -p 10080:80 -- link postgresql:postgresql --link redis:redisio gitlab 18