Skip to content

Latest commit

 

History

History
104 lines (71 loc) · 2.75 KB

File metadata and controls

104 lines (71 loc) · 2.75 KB

Docker, Kubernetes & openshift course

Keynote

  • Introducción a la tecnología de contenedores
  • Creación de servicios en contenedores
  • Gestión de contenedores
  • Gestión de imágenes de contenedores
  • Creación de imágenes de contenedor personalizadas
  • Kubernetes
  • Implementación de aplicaciones en contenedores con OpenShift
  • Revisión completa

Docker

Accelerate how you build, share and run modern applications


Docker engine

Demo

  • Play with docker run -i -t ubuntu /bin/bash
  • Try to install something, and rerun the container
  • Learn about what happened.
  • Now with some volume and port:
    • PowerShell docker run --rm -p 80:80 -v ${pwd}:/usr/share/nginx/html/ nginx
    • Bash docker run --rm -p 80:80 -v $(pwd):/usr/share/nginx/html/ nginx
  • Remove all containers: docker rm $(docker ps -aq)
  • Manage images: docker image
  • Run containers: docker run
  • Pull images: docker pull

Installation


Dockerfile

Items

  • FROM
  • RUN
  • WORKDIR
  • COPY
  • EXPOSE
  • CMD
  • ENV
  • VOLUME

Demo

move to demo ./move/to.sh dockerfile

  • Build docker build --rm -t docker-app .
  • Run docker run --rm -p 80:80 --name my-app docker-app
  • Entry into the container docker exec -it my-app /bin/bash
  • Run with volume (for developers):
    • PowerShell docker run --rm -p 80:80 -v ${pwd}:/usr/share/nginx/html/ --name my-app docker-app
    • Bash docker run --rm -p 80:80 -v $(pwd):/usr/share/nginx/html/ --name my-app docker-app

Hands On

Dockerize front npm App: move to practice ./move/to.sh dockerize

  • Install dependencies npm install
  • Build app npm run build
  • Public files dist/docker-app
  • Run app npm start
  • Run app all interfaces npm start -- --host 0.0.0.0

Solution: ./move/to.sh dockerize-solution


docker-compose

Hands On

  • Try to translate the Dockerfile in a docker-compose.yml

Solution: ./move/to.sh compose-solution

Kubernetes

Move to ./move/to.sh Kubernetes