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

Docker?! But I'm a frontend.

Docker?! But I'm a frontend.

Shipping and developing applications in different environments are hard and we became masters of workarounds. Docker makes our lives easier by shipping and running consistently the same container in every environment.

4804f554e4517c893086e6abb1ef6559?s=128

Michael Lancaster

September 25, 2017
Tweet

Transcript

  1. Docker? but I’m a developer Photo by Axel Ahoi on

    Unsplash
  2. Michael Lancaster @weblancaster

  3. Docker who?!

  4. None
  5. None
  6. What is Docker?

  7. Hypervisor Hardware App A Bins/Libs Guest OS App B Bins/Libs

    Guest OS App C Bins/Libs Guest OS VM Virtual Machines
  8. Docker Host OS Hardware Bins/Libs Bins/Libs Bins/Libs Redis Nginx Python

    Containers Container
  9. Container (writable, running application) Layered image 2 (read-only) Layered image

    1 (read-only) Platform image (runtime environment, read-only) Image layers
  10. Why Docker?

  11. Cost savings Productivity increase Consistency across environments Lightweight Security Isolation

  12. How to Install https://docs.docker.com/engine/installation/#supported-platforms

  13. None
  14. Using CLI https://docs.docker.com/engine/reference/builder

  15. $ docker run -p 8080:80 --name static -d nginx CLI:

  16. Using Dockerfile https://docs.docker.com/engine/reference/builder

  17. Dockerfile: FROM nginx COPY build /usr/share/nginx/html $ docker build -t

    static-web . $ docker run -p 8080:80 --name static -d static-web Build image: Run container:
  18. Using Docker-compose https://docs.docker.com/compose/compose-file

  19. $ docker-compose -f docker-compose.yml up -d CLI: version: “3” services:

    static: container_name: frontinbh_static build: . ports: - "8080:80" server: image: mhart/alpine-node:latest working_dir: /usr/src/app container_name: frontinbh_server volumes: - ./server:/usr/src/app ports: - "3000:3000" command: npm start docker-compose.yml:
  20. Releasing the image https://docs.docker.com/docker-cloud/builds/push-images/

  21. Tag image: $ docker tag frontinbh_static weblancaster/frontinbh_static $ docker login

    $ docker push weblancaster/frontinbh_static Registry login (Dockerhub default): Push image:
  22. Deployment Strategies

  23. None
  24. Thanks! https://github.com/weblancaster/frontinbh-docker-talk