Diese Präsentation wurde erfolgreich gemeldet.
Wir verwenden Ihre LinkedIn Profilangaben und Informationen zu Ihren Aktivitäten, um Anzeigen zu personalisieren und Ihnen relevantere Inhalte anzuzeigen. Sie können Ihre Anzeigeneinstellungen jederzeit ändern.

Docker workshop

212 Aufrufe

Veröffentlicht am

Docker workshop

Veröffentlicht in: Technologie
  • Loggen Sie sich ein, um Kommentare anzuzeigen.

Docker workshop

  1. 1. DOCKER An introduction Matthias Noback @matthiasnoback info@matthiasnoback.nl
  2. 2. CONTAINERS "Just" processes, connected through the network Your application MySQL Varnish Memcache Redis HAProxy
  3. 3. CONTAINERS Are about isolation Processes Files Networking Resources Users
  4. 4. DOCKER A set of CLI scripts docker build docker run docker volume docker network ...
  5. 5. localhost DOCKER A daemon and a client Docker daemon client container container container
  6. 6. some-other-machine DOCKER A daemon and a client Docker daemon client container container container
  7. 7. IMAGES Container blueprints Files Exposed ports Volumes
  8. 8. IMAGES Pull or build Image registry image Docker- file image pull from use to build
  9. 9. IMAGE REGISTRY hub.docker.com
  10. 10. IMAGE REGISTRY Push your own images Image registry push to Docker- file image use to build
  11. 11. CONTAINERS Linked through Networks
  12. 12. CONTAINERS Configured through Build process Environment variables Volume mounts
  13. 13. ASSIGNMENTS/ ALL.MD Playing with docker and Dockerfiles https://github.com/matthiasnoback/docker-workshop/
  14. 14. EXPOSE VS PUBLISH A port is exposed by the image itself Publishing it makes it accessible to the bridge network (possible conflicts) You can map ports: [host port]:[container port]
  15. 15. DOCKERFILE Describes the build process of a container image FROM php:7.1-apache COPY web/ /var/www/html/ RUN pecl install redis RUN docker-php-ext-enable redis Cached filesystem layers!
  16. 16. DOCKERFILE Optimized build FROM php:7.1-apache RUN pecl install redis docker-php-ext-enable redis COPY web/ /var/www/html/
  17. 17. BUILD CONTEXT Files available while building the image COPY web/ /var/www/html/
  18. 18. LOGGING To stdout/stderr No file rotation needed You could look into logspout/Logstash/Kibana There are also nice services for this
  19. 19. COPYING VS VOLUME MOUNTING When to use what Mount a volume while developing Use COPY for creating the build artifact
  20. 20. READ-ONLY LAYERS With a writeable layer on top Stateful vs immutable
  21. 21. IMMUTABLE FILE SYSTEMS How to store data on disk? bind-mount volume named volume ("volumes from") fast/cache volume: tmpfs
  22. 22. CONTAINERS Advantages Self-contained ;) Designed to be immutable (and predictable) Infrastructure as code Configuration has not been abstracted Provisioning new servers is easy

×