Skip to content
This repository was archived by the owner on Nov 10, 2020. It is now read-only.

Commit 5e6645d

Browse files
committed
Ignore DL3006 and DL3008 by default
1 parent 2ce0b49 commit 5e6645d

File tree

10 files changed

+20
-21
lines changed

10 files changed

+20
-21
lines changed

.hadolint.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
ignored:
2+
- DL3006
3+
- DL3008

all-spark-notebook/Dockerfile

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Copyright (c) Jupyter Development Team.
22
# Distributed under the terms of the Modified BSD License.
33
ARG BASE_CONTAINER=jupyter/pyspark-notebook
4-
# hadolint ignore=DL3006
54
FROM $BASE_CONTAINER
65

76
LABEL maintainer="Jupyter Project <jupyter@googlegroups.com>"
@@ -13,7 +12,6 @@ ENV R_LIBS_USER $SPARK_HOME/R/lib
1312
RUN fix-permissions $R_LIBS_USER
1413

1514
# R pre-requisites
16-
# hadolint ignore=DL3008
1715
RUN apt-get update && \
1816
apt-get install -y --no-install-recommends \
1917
fonts-dejavu \

base-notebook/Dockerfile

-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
# OS/ARCH: linux/amd64
77
ARG ROOT_CONTAINER=ubuntu:bionic-20200403@sha256:b58746c8a89938b8c9f5b77de3b8cf1fe78210c696ab03a1442e235eea65d84f
88
ARG BASE_CONTAINER=$ROOT_CONTAINER
9-
# hadolint ignore=DL3006
109
FROM $BASE_CONTAINER
1110

1211
LABEL maintainer="Jupyter Project <jupyter@googlegroups.com>"
@@ -22,7 +21,6 @@ USER root
2221
# Install all OS dependencies for notebook server that starts but lacks all
2322
# features (e.g., download as all possible file formats)
2423
ENV DEBIAN_FRONTEND noninteractive
25-
# hadolint ignore=DL3008
2624
RUN apt-get update \
2725
&& apt-get install -yq --no-install-recommends \
2826
wget \

datascience-notebook/Dockerfile

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Copyright (c) Jupyter Development Team.
22
# Distributed under the terms of the Modified BSD License.
33
ARG BASE_CONTAINER=jupyter/scipy-notebook
4-
# hadolint ignore=DL3006
54
FROM $BASE_CONTAINER
65

76
LABEL maintainer="Jupyter Project <jupyter@googlegroups.com>"
@@ -16,7 +15,6 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"]
1615
USER root
1716

1817
# R pre-requisites
19-
# hadolint ignore=DL3008
2018
RUN apt-get update && \
2119
apt-get install -y --no-install-recommends \
2220
fonts-dejavu \

docs/contributing/lint.md

+16-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Image Lint
22

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` .
44

55
## Installation
66

@@ -51,18 +51,28 @@ $ make lint-all
5151

5252
## Ignoring Rules
5353

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`.
5563

5664
> 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:
5765
5866
```dockerfile
59-
# hadolint ignore=DL3006
67+
6068
FROM ubuntu
6169

6270
# hadolint ignore=DL3003,SC1035
6371
RUN cd /tmp && echo "hello!"
6472
```
6573

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

minimal-notebook/Dockerfile

-2
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
# Copyright (c) Jupyter Development Team.
22
# Distributed under the terms of the Modified BSD License.
33
ARG BASE_CONTAINER=jupyter/base-notebook
4-
# hadolint ignore=DL3006
54
FROM $BASE_CONTAINER
65

76
LABEL maintainer="Jupyter Project <jupyter@googlegroups.com>"
87

98
USER root
109

1110
# Install all OS dependencies for fully functional notebook server
12-
# hadolint ignore=DL3008
1311
RUN apt-get update && apt-get install -yq --no-install-recommends \
1412
build-essential \
1513
emacs-nox \

pyspark-notebook/Dockerfile

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Copyright (c) Jupyter Development Team.
22
# Distributed under the terms of the Modified BSD License.
33
ARG BASE_CONTAINER=jupyter/scipy-notebook
4-
# hadolint ignore=DL3006
54
FROM $BASE_CONTAINER
65

76
LABEL maintainer="Jupyter Project <jupyter@googlegroups.com>"
@@ -14,7 +13,7 @@ USER root
1413
# Spark dependencies
1514
ENV APACHE_SPARK_VERSION=2.4.5 \
1615
HADOOP_VERSION=2.7
17-
# hadolint ignore=DL3008
16+
1817
RUN apt-get -y update && \
1918
apt-get install --no-install-recommends -y openjdk-8-jre-headless ca-certificates-java && \
2019
rm -rf /var/lib/apt/lists/*

r-notebook/Dockerfile

-2
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
# Copyright (c) Jupyter Development Team.
22
# Distributed under the terms of the Modified BSD License.
33
ARG BASE_CONTAINER=jupyter/minimal-notebook
4-
# hadolint ignore=DL3006
54
FROM $BASE_CONTAINER
65

76
LABEL maintainer="Jupyter Project <jupyter@googlegroups.com>"
87

98
USER root
109

1110
# R pre-requisites
12-
# hadolint ignore=DL3008
1311
RUN apt-get update && \
1412
apt-get install -y --no-install-recommends \
1513
fonts-dejavu \

scipy-notebook/Dockerfile

-2
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
# Copyright (c) Jupyter Development Team.
22
# Distributed under the terms of the Modified BSD License.
33
ARG BASE_CONTAINER=jupyter/minimal-notebook
4-
# hadolint ignore=DL3006
54
FROM $BASE_CONTAINER
65

76
LABEL maintainer="Jupyter Project <jupyter@googlegroups.com>"
87

98
USER root
109

1110
# ffmpeg for matplotlib anim & dvipng for latex labels
12-
# hadolint ignore=DL3008
1311
RUN apt-get update && \
1412
apt-get install -y --no-install-recommends ffmpeg dvipng && \
1513
rm -rf /var/lib/apt/lists/*

tensorflow-notebook/Dockerfile

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Copyright (c) Jupyter Development Team.
22
# Distributed under the terms of the Modified BSD License.
33
ARG BASE_CONTAINER=jupyter/scipy-notebook
4-
# hadolint ignore=DL3006
54
FROM $BASE_CONTAINER
65

76
LABEL maintainer="Jupyter Project <jupyter@googlegroups.com>"

0 commit comments

Comments
 (0)