12. Best Practices
Overview
In this chapter, you will learn some of the best practices to use when working with Docker and your container images. This will enable you to monitor and manage the resources used by your container and limit their effect on your host system. You will analyze Docker's best practices and learn why it's important to only be running one service per container, ensuring that your containers are scalable and immutable and making sure that your underlying applications start in a short amount of time. This chapter will help you to enforce these best practices by linting your Dockerfiles
and docker-compose.yml
files before your applications and containers are running with the help of hadolint's
FROM:latest
command and dcvalidator
.