|
1 | 1 | # Image Lint
|
2 | 2 |
|
3 |
| -To comply with [Docker best practices][LK2], we are using the [Hadolint][LK1] tool to analyse each `Dockerfile` . |
| 3 | +To comply with [Docker best practices][dbp], we are using the [Hadolint][hadolint] tool to analyse each `Dockerfile` . |
4 | 4 |
|
5 | 5 | ## Installation
|
6 | 6 |
|
@@ -51,18 +51,28 @@ $ make lint-all
|
51 | 51 |
|
52 | 52 | ## Ignoring Rules
|
53 | 53 |
|
54 |
| -Sometimes it is necessary to ignore [some rules][LK3]. The preferred way to do it is to flag ignored rules in the `Dockerfile`. |
| 54 | +Sometimes it is necessary to ignore [some rules][rules]. |
| 55 | +The following rules are ignored by default and sor for all images in the `.hadolint.yaml` file. |
| 56 | + |
| 57 | +- [`DL3006`][DL3006]: We use a specific policy to manage image tags. |
| 58 | + - `base-notebook` `FROM` clause is fixed but based on an argument (`ARG`). |
| 59 | + - Building downstream images from (`FROM`) the latest is done on purpose. |
| 60 | +- [`DL3008`][DL3008]: System packages are always updated (`apt-get`) to the latest version. |
| 61 | + |
| 62 | +For other rules, the preferred way to do it is to flag ignored rules in the `Dockerfile`. |
55 | 63 |
|
56 | 64 | > It is also possible to ignore rules by using a special comment directly above the Dockerfile instruction you want to make an exception for. Ignore rule comments look like `# hadolint ignore=DL3001,SC1081`. For example:
|
57 | 65 |
|
58 | 66 | ```dockerfile
|
59 |
| -# hadolint ignore=DL3006 |
| 67 | + |
60 | 68 | FROM ubuntu
|
61 | 69 |
|
62 | 70 | # hadolint ignore=DL3003,SC1035
|
63 | 71 | RUN cd /tmp && echo "hello!"
|
64 | 72 | ```
|
65 | 73 |
|
66 |
| -[LK1]: https://github.com/hadolint/hadolint |
67 |
| -[LK2]: https://docs.docker.com/develop/develop-images/dockerfile_best-practices |
68 |
| -[LK3]: https://github.com/hadolint/hadolint#rules |
| 74 | +[hadolint]: https://github.com/hadolint/hadolint |
| 75 | +[dbp]: https://docs.docker.com/develop/develop-images/dockerfile_best-practices |
| 76 | +[rules]: https://github.com/hadolint/hadolint#rules |
| 77 | +[DL3006]: https://github.com/hadolint/hadolint/wiki/DL3006 |
| 78 | +[DL3008]: https://github.com/hadolint/hadolint/wiki/DL3008 |
0 commit comments