Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This tutorial is designed to explain docker and what you can do with it.

Table of Contents
Table of Contents
outlinetrue

Getting to know docker

Prerequisites

For this tutorial you just need terminal access and being able to run the system!

Introduction

So what is this 'docker' thing you keep reading? Honestly I probably cannot explain it better than their site does.

In very short: It allows running multiple virtual machines, computers, on your own (single) computer, all with a single command (okay, and a configured file). As it says on their site it eliminates the differences between machines and makes overall installation of a system like this ez pz.

Steps to take

Looking around

  1. Open the Docker-compose.yml file
    1. Notice several containers, each starting with ther name
    2. Each container starts with an image, the base machine
    3. It has some configuration, for example mapping ports
    4. It has some volumes
    5. This is the file that defines which containers to use and how to build them
      1. It is what instructs the `docker-compose up` command what to do
  2. Open a Dockerfile
    1. These files add additional instructions on how to build each container
      1. It defines actions to do on the images (which are downloaded from dockerhub)
      2. Building means preparing, a container is first build and can later on be run
        1. You can store containers when they are build, you can even upload and download them!
    2. It starts with a `FROM` command, defining the base image
    3. It can execute shell commands using the `RUN` keyword
    4. it can add files to the container using the `ADD` keyword
    5. it can define a command to run when the container starts (which is later) using the `CMD` keyword
    6. Now about this specific Dockerfile:
      1. It is for the core microservice, notice how it is in the core repostiory (this is to reduce dependency issues)
        1. Understanding each command requires some experience with Linux and is out of the scope for this tutorial
      2. It starts with a base image and sets some settings
      3. Next it installs some software dependencies we have
        1. Starting with adding the PHP 7 ppa repository
        2. After which it installs several PHP-7.1 extensions and general utility packages
        3. It installs composer, a PHP dependency manager
      4. After the dependencies it adds the bootstrap.sh file for the core
        1. The bootstrap file (script) is basically a set of shell commands to run after each other
      5. Finally it defines the command to run when starting the container
        1. In this case, this is mostly delegated to the bootstrap.sh file
    7. You can find more information about the Dockerfile here.

Common docker commands

This section is a more detailed version of the docker section on the usage tips page.

...