Summary

In this chapter, we learned how to use Docker commands to create and operate containers. We learned most of the commonly used Docker commands, such as build, run, exec, ps, images, tagand push.

We saw how to build a web service container, including the preparation of configuration files, how to structure a Dockerfile, and how to make our images as small as possible. We also covered how to use docker-compose to operate locally and, through a docker-compose.yaml file, connect different containers running in a cluster configuration. This included creating a database container that allows testing much closer to what the production deployment will be, using the same tools.

We saw how to use environment variables to configure our service and how to inject them through docker-compose configuration to allow different modes, such as testing. 

Finally, we analyzed how to use a registry to share our images, and how to tag them adequately and allow moving them out from local development, ready to be used in a deployment.

In the next chapter, we will see how to leverage the created containers and actions to run tests automatically and make automated tools do the heavy lifting for us to be sure our code is always high-quality!