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

Introduction to Docker

Introduction to Docker

Ulugbek Miniyarov

May 04, 2018
Tweet

More Decks by Ulugbek Miniyarov

Other Decks in Technology

Transcript

  1. A brief explanation of containers An image is a lightweight,

    stand-alone, executable package that includes everything needed to run a piece of software, including the code, a runtime, libraries, environment variables, and config files. A container is a runtime instance of an image – what the image becomes in memory when actually executed. It runs completely isolated from the host environment by default, only accessing host files and ports if configured to do so. Containers run apps natively on the host machine’s kernel.
  2. What is an image? • An image is a collection

    of files + some meta data. (Technically: those files form the root filesystem of a container.) • Images are made of layers, conceptually stacked on top of each other. • Each layer can add, change, and remove files. • Images can share layers to optimize disk usage, transfer times, and memory use. Example: Ubuntu > Varnish > Apache > PHP-FPM > Symfony > Dependencies > Application > Configuration
  3. Metaphor: Object-Oriented Programming • Images are conceptually similar to classes.

    • Layers are conceptually similar to inheritance. • Containers are conceptually similar to instances.
  4. Image namespaces There are three namespaces: • Official images: ubuntu,

    busybox ... • User (and organizations) images: miniyarov/symfony • Self-hosted images: registry.enuygun.com/flight/image
  5. Dockerfile • Manual process = bad. • Automated process =

    good. Let’s learn how to automate the build process by writing a Dockerfile. $ docker build -t figlet . $ docker run -it figlet root@<imageId>:/# figlet hello
  6. Containers as services: Docker Compose A docker-compose.yml file is a

    YAML file that defines how Docker containers should behave
  7. Resources for further study: Official Get Started: https://docs.docker.com/get-started/ Another Good

    Explanation: http://view.dckr.info/DockerIntro.pdf Another Container Orchestration by Google: Kubernetes.io