Enforcing Docker Best Practices in Your Code
Just as we look to make our coding easier when we are developing applications, we can use external service and tests to make sure our Docker images are adhering to the best practices. In the following sections of this chapter, we are going to use three tools to make sure that our Dockerfiles
and docker-compose.yml
files are adhering to the best practices, as well as making sure we are not introducing potential issues when our Docker images are built.
The tools included will be straightforward to use and provide powerful functionality. We will start by using hadolint
to lint our Dockerfiles
directly on our system, which will run as a separate Docker image that we feed our Dockerfiles
into. We then take a look at FROM:latest
, which is an online service that provides some basic functionality in helping us pinpoint issues with our Dockerfiles
. Lastly, we then look at Docker Compose Validator (DCValidator), which will perform a similar function...