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