1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

【Docker】hadolintの導入方法

1
Posted at

hadolintとは

hadolintはDockerfileのリンターです。

導入方法

Homebrewを使用してインストールします。

brew install hadolint

Homebrewを使用しない場合には以下

使用方法

CLI

次のようにコマンドを実行することで使用できます。

hadolint Dockerfileのパス
$ hadolint Dockerfile
Dockerfile:12 DL3059 info: Multiple consecutive `RUN` instructions. Consider consolidation.
Dockerfile:12 SC2086 info: Double quote to prevent globbing and word splitting.
Dockerfile:17 SC2086 info: Double quote to prevent globbing and word splitting.

VSCode

拡張機能をインストールするとVSCode上で使用できます。

インストール後Dockerfileを開くと以下のように警告が表示されるようになります。

D84F2B4D-D3E9-44DB-8BFB-16108BE7EB38.png

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?