A quick way to detect bad practices on a Dockerfile

luzfcb

Fábio C. Barrionuevo da Luz

Posted on April 28, 2020

A quick way to detect bad practices on a Dockerfile

In Feldroy we use Docker images as the base to running the tools to build the PDF, EPUB, and Kindle files from the content written by @audreyfeldroy and @danielfeldroy .

Having a 100% functional Dockerfile that follows good practices is a good thing to have.

The hadolint is a linter tool that helps to validate a Dockerfile to build Docker images that follow the recommendations of the Best practices for writing Dockerfiles guide.

A quick way to use

docker run --rm -i hadolint/hadolint < Dockerfile

What is the validation rules

The validation follows these rules: https://github.com/hadolint/hadolint#rules

How to customize the validation

We can customize the validation by creating the .hadolint.yaml file: https://github.com/hadolint/hadolint#configure

How to integrate on the CI Server

There are several examples of how to use hadolint on CI servers: https://github.com/hadolint/hadolint/blob/master/docs/INTEGRATION.md

💖 💪 🙅 🚩
luzfcb
Fábio C. Barrionuevo da Luz

Posted on April 28, 2020

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related