Skip to content

Commit 35729fa

Browse files
committed
fix installing rsync by specifying a minimum rather than exact version
hadolint complains about installing apt packages without specifying a version. For rsync, this is exceedingly unlikely to be a problem, but still in spirit it makes sense to be more explicit. Specifying the version explicitly has caused problems several times because our base image has changed, and the given versions are no longer available. Instead of specifying an exact package, we can use apt-get satisfy, which accepts a version string that can specify a minimum version. I'm not sure if hadolint understands apt-get satisfy, but this stops it from complaining. And it already wasn't complaining about not specifying jq's version. Also move the ignore rule about using a latest tag to an inline comment rather than in a separate file. This means it explicitly only covers the metacpan-base image, rather than any other image that could be in the file. Currently, there aren't any targets, but they could be added in the future and if they are using images that we don't control, we shouldn't be using latest.
1 parent d786883 commit 35729fa

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

Diff for: .hadolint.yaml

-4
This file was deleted.

Diff for: Dockerfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# hadolint ignore=DL3007
12
FROM metacpan/metacpan-base:latest
23

34
COPY cpanfile cpanfile.snapshot /metacpan-api/
@@ -9,7 +10,7 @@ WORKDIR /metacpan-api
910
# size of the images.
1011
RUN mkdir /CPAN \
1112
&& apt-get update \
12-
&& apt-get install -y --no-install-recommends rsync=3.2.3-4+deb11u1 jq \
13+
&& apt-get satisfy -y --no-install-recommends 'rsync (>= 3.2.3)' 'jq (>= 1.6)' \
1314
&& apt-get clean \
1415
&& rm -rf /var/lib/apt/lists/* \
1516
&& cpm install --global \

0 commit comments

Comments
 (0)