Skip to content

Commit ba5d0b8

Browse files
authored
Update hadolint configuration (#1142)
The `hadolint` warning DL3009 is only relevant when optimizing a docker container's size. It's not needed for security or other reasons. Not only is this rule annoying; following the rule can also increase docker image build times. The benefit does not seem to outweight the drawbacks, so I added it to the list of ignored rules. Conversely, DL3047 (about the syntax of CMD statements) is probably better to keep, as a matter of modern practices surrounding Dockerfiles.
1 parent 9f3a2ee commit ba5d0b8

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

.hadolint.yaml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Summary: configure the Dockerfile linter program "hadolint" for this project.
2+
#
13
# Copyright 2025 Google LLC
24
#
35
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -12,16 +14,16 @@
1214
# See the License for the specific language governing permissions and
1315
# limitations under the License.
1416

15-
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
16-
# Hadolint (Dockerfile linter) used in this project's CI checks.
1717
# Info about options can be found at https://github.com/hadolint/hadolint/.
18-
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
19-
2018
format: tty
2119
no-color: false
2220
no-fail: false
2321
failure-threshold: error
22+
23+
# Rule/error numbers are described at https://github.com/hadolint/hadolint/wiki
2424
ignored:
25+
# Don't complain about not deleting the apt lists after every apt-get install.
26+
- DL3009
2527
- DL3025
26-
- DL3047
28+
# Multiple consecutive RUN stmts are usually deliberate. Don't flag that.
2729
- DL3059

0 commit comments

Comments
 (0)