Home Repo

To follow the rest of these blog posts, you must have a basic knowledge of Docker and Git, so let’s take a brief detour…

Docker

My introduction to DevOps was after I built a service which was going to be deployed on an AWS ECS (Elastic Container Service) cluster. This service needed to be “dockerised”. This means it needed to be created within a reliably recreatable environment known as a container.

Docker is the containerisation software which enables us to do the above by building environments with a YAML template known as a Dockerfile . We can build our environments on top of base images such as Ubuntu e.g.

FROM ubuntu:18.04

RUN apk update

and you can run it like this:

docker build -t myFirstDockerContainer . && docker run myFirstDockerContainer

The Docker CLI enables you to control containers and push and pull images from registries such as DockerHub. However, you can use it to control a lot more, including networks, volumes, and even collections of containers working together as part of a swarm.

In my opinion, Docker is great. The main reason for this is that I spend less time debugging… I hate debugging. Software engineering to me is all about creating and I shouldn’t spend my time being a software mechanic.

Go ahead and explore DockerHub. If there isn’t an image for your favourite software, why not make it and publish it (preferably using alpine — the smallest base image).

Docker-Compose

After you’ve explored Docker, you’ll soon want to connect your separate services. For example, if you want to run a web app with a database. To set this up in a single file there exists docker-compose.

version: "3" networks:

someNetwork: volumes:

someVolume: services:

webapp:

image: someWebAppImage database:

image: someDatabaseImage

Docker-compose is elegant, simple and a big upgrade to my developing practice.