Branch: master
Find file Copy path
141 lines (103 sloc) 3.87 KB

Hadolint Integrations

Automated Code Review


Codacy automates hadolint code reviews on every commit and pull request, reporting code style and error prone issues.

Travis CI

Integration with Travis CI requires minimal changes and adding less than two seconds to your build time.

# Use container-based infrastructure for quicker build start-up
sudo: false
# Use generic image to cut start-up time
language: generic
  # Path to 'hadolint' binary
  HADOLINT: "${HOME}/hadolint"
  # Download hadolint binary and set it as executable
  - curl -sL -o ${HADOLINT} "$(uname -s)-$(uname -m)"
    && chmod 700 ${HADOLINT}
  # List files which name starts with 'Dockerfile'
  # eg. Dockerfile,, etc.
  - git ls-files --exclude='Dockerfile*' --ignored | xargs --max-lines=1 ${HADOLINT}

Gitlab CI

For GitLab CI you need a basic shell in your docker image so you have to use the debian based images of hadolint.

Add the following job to your project's .gitlab-ci.yml:

  stage: lint
  image: hadolint/hadolint:latest-debian
    - hadolint Dockerfile

Drone CI

For Drone CI, a basic shell is similiarly required.

Add the following job to your project's .drone.yml pipeline:

    group: validate
    image: hadolint/hadolint:latest-debian
      - hadolint --version
      - hadolint Dockerfile

Codeship Pro

Add the hadolint docker container on codeship-services.yml with a docker volume with the repository attached to it:

  image: hadolint/hadolint:latest-debian
    - ./:/test

Then add the CI step on codeship-steps.yml with the path of the dockerfile

- type: parallel
  # optional: set branches
  tag: '^(master|develop/.*)$'
    - service: hadolint
      command: hadolint /test/Dockerfile


Using hadolint in your terminal is not always the most convinient way, but it can be integrated into your editor to give you a feedback as you write your Dockerfile.


Atom is a text editor that's modern, approachable, yet hackable to the core—a tool you can customize to do anything but also use productively without ever touching a config file.

Thanks to lucasdf, there is an integration linter-hadolint with Atom.


Sublime Text 3

A sophisticated text editor for code, markup and prose.

Thanks to niksite, there is an integration SublimeLinter-contrib-hadolint with Sublime Text.

Vim and NeoVim

Hadolint is used in two plugins:

  • Syntastic - syntax checking plugin for Vim created by Martin Grenfell.

  • ALE (Asynchronous Lint Engine) - plugin for providing linting in NeoVim and Vim 8 while you edit your text files.

VS Code

Visual Studio Code is a lightweight but powerful source code editor which runs on your desktop and is available for Windows, macOS and Linux.

There is an integration vscode-hadolint with VS Code, built by ExiaSR.