Skip to content

Commit 686474f

Browse files
committed
Disable Hadolint check for consecutive RUN instructions (DL3059)
This check doesn't seem to add enough value to justify the difficulties it tends to create when generating `RUN` instructions from a template.
1 parent 2c6bd8c commit 686474f

18 files changed

+2
-53
lines changed

.hadolint.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,7 @@ ignored:
33
- DL3008
44
# disable explicit version for apk install
55
- DL3018
6+
# disable check for consecutive `RUN` instructions
7+
- DL3059
68
trustedRegistries:
79
- docker.io

docker/Dockerfile.j2

-5
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ ENV RUSTFLAGS='-Clink-arg=/usr/local/musl/{{ package_arch_target }}/lib/libatomi
106106
{% elif "arm" in target_file %}
107107
#
108108
# Install required build libs for {{ package_arch_name }} architecture.
109-
# hadolint ignore=DL3059
110109
RUN dpkg --add-architecture {{ package_arch_name }} \
111110
&& apt-get update \
112111
&& apt-get install -y \
@@ -178,7 +177,6 @@ RUN touch src/main.rs
178177

179178
# Builds again, this time it'll just be
180179
# your actual source files being built
181-
# hadolint ignore=DL3059
182180
RUN {{ mount_rust_cache -}} cargo build --features ${DB} --release{{ package_arch_target_param }}
183181

184182
######################## RUNTIME IMAGE ########################
@@ -195,7 +193,6 @@ ENV ROCKET_PROFILE="release" \
195193

196194

197195
{% if "amd64" not in target_file %}
198-
# hadolint ignore=DL3059
199196
RUN [ "cross-build-start" ]
200197
{% endif %}
201198

@@ -222,13 +219,11 @@ RUN mkdir /data \
222219
{% if "armv6" in target_file and "alpine" not in target_file %}
223220
# In the Balena Bullseye images for armv6/rpi-debian there is a missing symlink.
224221
# This symlink was there in the buster images, and for some reason this is needed.
225-
# hadolint ignore=DL3059
226222
RUN ln -v -s /lib/ld-linux-armhf.so.3 /lib/ld-linux.so.3
227223

228224
{% endif -%}
229225

230226
{% if "amd64" not in target_file %}
231-
# hadolint ignore=DL3059
232227
RUN [ "cross-build-end" ]
233228
{% endif %}
234229

docker/amd64/Dockerfile

-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ RUN touch src/main.rs
8181

8282
# Builds again, this time it'll just be
8383
# your actual source files being built
84-
# hadolint ignore=DL3059
8584
RUN cargo build --features ${DB} --release
8685

8786
######################## RUNTIME IMAGE ########################

docker/amd64/Dockerfile.alpine

-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ RUN touch src/main.rs
7575

7676
# Builds again, this time it'll just be
7777
# your actual source files being built
78-
# hadolint ignore=DL3059
7978
RUN cargo build --features ${DB} --release --target=x86_64-unknown-linux-musl
8079

8180
######################## RUNTIME IMAGE ########################

docker/amd64/Dockerfile.buildkit

-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ RUN touch src/main.rs
8181

8282
# Builds again, this time it'll just be
8383
# your actual source files being built
84-
# hadolint ignore=DL3059
8584
RUN --mount=type=cache,target=/root/.cargo/git --mount=type=cache,target=/root/.cargo/registry cargo build --features ${DB} --release
8685

8786
######################## RUNTIME IMAGE ########################

docker/amd64/Dockerfile.buildkit.alpine

-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ RUN touch src/main.rs
7575

7676
# Builds again, this time it'll just be
7777
# your actual source files being built
78-
# hadolint ignore=DL3059
7978
RUN --mount=type=cache,target=/root/.cargo/git --mount=type=cache,target=/root/.cargo/registry cargo build --features ${DB} --release --target=x86_64-unknown-linux-musl
8079

8180
######################## RUNTIME IMAGE ########################

docker/arm64/Dockerfile

-4
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ RUN mkdir -pv "${CARGO_HOME}" \
4646

4747
#
4848
# Install required build libs for arm64 architecture.
49-
# hadolint ignore=DL3059
5049
RUN dpkg --add-architecture arm64 \
5150
&& apt-get update \
5251
&& apt-get install -y \
@@ -101,7 +100,6 @@ RUN touch src/main.rs
101100

102101
# Builds again, this time it'll just be
103102
# your actual source files being built
104-
# hadolint ignore=DL3059
105103
RUN cargo build --features ${DB} --release --target=aarch64-unknown-linux-gnu
106104

107105
######################## RUNTIME IMAGE ########################
@@ -113,7 +111,6 @@ ENV ROCKET_PROFILE="release" \
113111
ROCKET_ADDRESS=0.0.0.0 \
114112
ROCKET_PORT=80
115113

116-
# hadolint ignore=DL3059
117114
RUN [ "cross-build-start" ]
118115

119116
# Create data folder and Install needed libraries
@@ -128,7 +125,6 @@ RUN mkdir /data \
128125
&& apt-get clean \
129126
&& rm -rf /var/lib/apt/lists/*
130127

131-
# hadolint ignore=DL3059
132128
RUN [ "cross-build-end" ]
133129

134130
VOLUME /data

docker/arm64/Dockerfile.alpine

-3
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ RUN touch src/main.rs
7575

7676
# Builds again, this time it'll just be
7777
# your actual source files being built
78-
# hadolint ignore=DL3059
7978
RUN cargo build --features ${DB} --release --target=aarch64-unknown-linux-musl
8079

8180
######################## RUNTIME IMAGE ########################
@@ -89,7 +88,6 @@ ENV ROCKET_PROFILE="release" \
8988
SSL_CERT_DIR=/etc/ssl/certs
9089

9190

92-
# hadolint ignore=DL3059
9391
RUN [ "cross-build-start" ]
9492

9593
# Create data folder and Install needed libraries
@@ -100,7 +98,6 @@ RUN mkdir /data \
10098
curl \
10199
ca-certificates
102100

103-
# hadolint ignore=DL3059
104101
RUN [ "cross-build-end" ]
105102

106103
VOLUME /data

docker/arm64/Dockerfile.buildkit

-4
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ RUN --mount=type=cache,target=/root/.cargo/git --mount=type=cache,target=/root/.
4646

4747
#
4848
# Install required build libs for arm64 architecture.
49-
# hadolint ignore=DL3059
5049
RUN dpkg --add-architecture arm64 \
5150
&& apt-get update \
5251
&& apt-get install -y \
@@ -101,7 +100,6 @@ RUN touch src/main.rs
101100

102101
# Builds again, this time it'll just be
103102
# your actual source files being built
104-
# hadolint ignore=DL3059
105103
RUN --mount=type=cache,target=/root/.cargo/git --mount=type=cache,target=/root/.cargo/registry cargo build --features ${DB} --release --target=aarch64-unknown-linux-gnu
106104

107105
######################## RUNTIME IMAGE ########################
@@ -113,7 +111,6 @@ ENV ROCKET_PROFILE="release" \
113111
ROCKET_ADDRESS=0.0.0.0 \
114112
ROCKET_PORT=80
115113

116-
# hadolint ignore=DL3059
117114
RUN [ "cross-build-start" ]
118115

119116
# Create data folder and Install needed libraries
@@ -128,7 +125,6 @@ RUN mkdir /data \
128125
&& apt-get clean \
129126
&& rm -rf /var/lib/apt/lists/*
130127

131-
# hadolint ignore=DL3059
132128
RUN [ "cross-build-end" ]
133129

134130
VOLUME /data

docker/arm64/Dockerfile.buildkit.alpine

-3
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ RUN touch src/main.rs
7575

7676
# Builds again, this time it'll just be
7777
# your actual source files being built
78-
# hadolint ignore=DL3059
7978
RUN --mount=type=cache,target=/root/.cargo/git --mount=type=cache,target=/root/.cargo/registry cargo build --features ${DB} --release --target=aarch64-unknown-linux-musl
8079

8180
######################## RUNTIME IMAGE ########################
@@ -89,7 +88,6 @@ ENV ROCKET_PROFILE="release" \
8988
SSL_CERT_DIR=/etc/ssl/certs
9089

9190

92-
# hadolint ignore=DL3059
9391
RUN [ "cross-build-start" ]
9492

9593
# Create data folder and Install needed libraries
@@ -100,7 +98,6 @@ RUN mkdir /data \
10098
curl \
10199
ca-certificates
102100

103-
# hadolint ignore=DL3059
104101
RUN [ "cross-build-end" ]
105102

106103
VOLUME /data

docker/armv6/Dockerfile

-5
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ RUN mkdir -pv "${CARGO_HOME}" \
4646

4747
#
4848
# Install required build libs for armel architecture.
49-
# hadolint ignore=DL3059
5049
RUN dpkg --add-architecture armel \
5150
&& apt-get update \
5251
&& apt-get install -y \
@@ -101,7 +100,6 @@ RUN touch src/main.rs
101100

102101
# Builds again, this time it'll just be
103102
# your actual source files being built
104-
# hadolint ignore=DL3059
105103
RUN cargo build --features ${DB} --release --target=arm-unknown-linux-gnueabi
106104

107105
######################## RUNTIME IMAGE ########################
@@ -113,7 +111,6 @@ ENV ROCKET_PROFILE="release" \
113111
ROCKET_ADDRESS=0.0.0.0 \
114112
ROCKET_PORT=80
115113

116-
# hadolint ignore=DL3059
117114
RUN [ "cross-build-start" ]
118115

119116
# Create data folder and Install needed libraries
@@ -130,10 +127,8 @@ RUN mkdir /data \
130127

131128
# In the Balena Bullseye images for armv6/rpi-debian there is a missing symlink.
132129
# This symlink was there in the buster images, and for some reason this is needed.
133-
# hadolint ignore=DL3059
134130
RUN ln -v -s /lib/ld-linux-armhf.so.3 /lib/ld-linux.so.3
135131

136-
# hadolint ignore=DL3059
137132
RUN [ "cross-build-end" ]
138133

139134
VOLUME /data

docker/armv6/Dockerfile.alpine

-3
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ RUN touch src/main.rs
7777

7878
# Builds again, this time it'll just be
7979
# your actual source files being built
80-
# hadolint ignore=DL3059
8180
RUN cargo build --features ${DB} --release --target=arm-unknown-linux-musleabi
8281

8382
######################## RUNTIME IMAGE ########################
@@ -91,7 +90,6 @@ ENV ROCKET_PROFILE="release" \
9190
SSL_CERT_DIR=/etc/ssl/certs
9291

9392

94-
# hadolint ignore=DL3059
9593
RUN [ "cross-build-start" ]
9694

9795
# Create data folder and Install needed libraries
@@ -102,7 +100,6 @@ RUN mkdir /data \
102100
curl \
103101
ca-certificates
104102

105-
# hadolint ignore=DL3059
106103
RUN [ "cross-build-end" ]
107104

108105
VOLUME /data

docker/armv6/Dockerfile.buildkit

-5
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ RUN --mount=type=cache,target=/root/.cargo/git --mount=type=cache,target=/root/.
4646

4747
#
4848
# Install required build libs for armel architecture.
49-
# hadolint ignore=DL3059
5049
RUN dpkg --add-architecture armel \
5150
&& apt-get update \
5251
&& apt-get install -y \
@@ -101,7 +100,6 @@ RUN touch src/main.rs
101100

102101
# Builds again, this time it'll just be
103102
# your actual source files being built
104-
# hadolint ignore=DL3059
105103
RUN --mount=type=cache,target=/root/.cargo/git --mount=type=cache,target=/root/.cargo/registry cargo build --features ${DB} --release --target=arm-unknown-linux-gnueabi
106104

107105
######################## RUNTIME IMAGE ########################
@@ -113,7 +111,6 @@ ENV ROCKET_PROFILE="release" \
113111
ROCKET_ADDRESS=0.0.0.0 \
114112
ROCKET_PORT=80
115113

116-
# hadolint ignore=DL3059
117114
RUN [ "cross-build-start" ]
118115

119116
# Create data folder and Install needed libraries
@@ -130,10 +127,8 @@ RUN mkdir /data \
130127

131128
# In the Balena Bullseye images for armv6/rpi-debian there is a missing symlink.
132129
# This symlink was there in the buster images, and for some reason this is needed.
133-
# hadolint ignore=DL3059
134130
RUN ln -v -s /lib/ld-linux-armhf.so.3 /lib/ld-linux.so.3
135131

136-
# hadolint ignore=DL3059
137132
RUN [ "cross-build-end" ]
138133

139134
VOLUME /data

docker/armv6/Dockerfile.buildkit.alpine

-3
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ RUN touch src/main.rs
7777

7878
# Builds again, this time it'll just be
7979
# your actual source files being built
80-
# hadolint ignore=DL3059
8180
RUN --mount=type=cache,target=/root/.cargo/git --mount=type=cache,target=/root/.cargo/registry cargo build --features ${DB} --release --target=arm-unknown-linux-musleabi
8281

8382
######################## RUNTIME IMAGE ########################
@@ -91,7 +90,6 @@ ENV ROCKET_PROFILE="release" \
9190
SSL_CERT_DIR=/etc/ssl/certs
9291

9392

94-
# hadolint ignore=DL3059
9593
RUN [ "cross-build-start" ]
9694

9795
# Create data folder and Install needed libraries
@@ -102,7 +100,6 @@ RUN mkdir /data \
102100
curl \
103101
ca-certificates
104102

105-
# hadolint ignore=DL3059
106103
RUN [ "cross-build-end" ]
107104

108105
VOLUME /data

docker/armv7/Dockerfile

-4
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ RUN mkdir -pv "${CARGO_HOME}" \
4646

4747
#
4848
# Install required build libs for armhf architecture.
49-
# hadolint ignore=DL3059
5049
RUN dpkg --add-architecture armhf \
5150
&& apt-get update \
5251
&& apt-get install -y \
@@ -101,7 +100,6 @@ RUN touch src/main.rs
101100

102101
# Builds again, this time it'll just be
103102
# your actual source files being built
104-
# hadolint ignore=DL3059
105103
RUN cargo build --features ${DB} --release --target=armv7-unknown-linux-gnueabihf
106104

107105
######################## RUNTIME IMAGE ########################
@@ -113,7 +111,6 @@ ENV ROCKET_PROFILE="release" \
113111
ROCKET_ADDRESS=0.0.0.0 \
114112
ROCKET_PORT=80
115113

116-
# hadolint ignore=DL3059
117114
RUN [ "cross-build-start" ]
118115

119116
# Create data folder and Install needed libraries
@@ -128,7 +125,6 @@ RUN mkdir /data \
128125
&& apt-get clean \
129126
&& rm -rf /var/lib/apt/lists/*
130127

131-
# hadolint ignore=DL3059
132128
RUN [ "cross-build-end" ]
133129

134130
VOLUME /data

docker/armv7/Dockerfile.alpine

-3
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ RUN touch src/main.rs
7575

7676
# Builds again, this time it'll just be
7777
# your actual source files being built
78-
# hadolint ignore=DL3059
7978
RUN cargo build --features ${DB} --release --target=armv7-unknown-linux-musleabihf
8079

8180
######################## RUNTIME IMAGE ########################
@@ -89,7 +88,6 @@ ENV ROCKET_PROFILE="release" \
8988
SSL_CERT_DIR=/etc/ssl/certs
9089

9190

92-
# hadolint ignore=DL3059
9391
RUN [ "cross-build-start" ]
9492

9593
# Create data folder and Install needed libraries
@@ -100,7 +98,6 @@ RUN mkdir /data \
10098
curl \
10199
ca-certificates
102100

103-
# hadolint ignore=DL3059
104101
RUN [ "cross-build-end" ]
105102

106103
VOLUME /data

docker/armv7/Dockerfile.buildkit

-4
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ RUN --mount=type=cache,target=/root/.cargo/git --mount=type=cache,target=/root/.
4646

4747
#
4848
# Install required build libs for armhf architecture.
49-
# hadolint ignore=DL3059
5049
RUN dpkg --add-architecture armhf \
5150
&& apt-get update \
5251
&& apt-get install -y \
@@ -101,7 +100,6 @@ RUN touch src/main.rs
101100

102101
# Builds again, this time it'll just be
103102
# your actual source files being built
104-
# hadolint ignore=DL3059
105103
RUN --mount=type=cache,target=/root/.cargo/git --mount=type=cache,target=/root/.cargo/registry cargo build --features ${DB} --release --target=armv7-unknown-linux-gnueabihf
106104

107105
######################## RUNTIME IMAGE ########################
@@ -113,7 +111,6 @@ ENV ROCKET_PROFILE="release" \
113111
ROCKET_ADDRESS=0.0.0.0 \
114112
ROCKET_PORT=80
115113

116-
# hadolint ignore=DL3059
117114
RUN [ "cross-build-start" ]
118115

119116
# Create data folder and Install needed libraries
@@ -128,7 +125,6 @@ RUN mkdir /data \
128125
&& apt-get clean \
129126
&& rm -rf /var/lib/apt/lists/*
130127

131-
# hadolint ignore=DL3059
132128
RUN [ "cross-build-end" ]
133129

134130
VOLUME /data

0 commit comments

Comments
 (0)