exercism / nim-test-runner

GNU Affero General Public License v3.0
2 stars 3 forks source link

Dockerfile: simplify `FROM` usage #79

Closed ee7 closed 3 years ago

ee7 commented 3 years ago

A simplification like this commit would be nice because:

ee7 commented 3 years ago

Oh, now I remember why I didn't do this. The whole point was to avoid gcc as a dependency for the production image.

And the hadolint issue is actually still there, so the best we can do is the below diff to main:

@@ -1,6 +1,6 @@
-ARG REPO=alpine
-ARG IMAGE=3.14.0@sha256:1775bebec23e1f3ce486989bfc9ff3c4e951690df84aa9f926497d82f2ffca9d
-FROM ${REPO}:${IMAGE} AS base
+ARG IMAGE=alpine3.14.0@sha256:1775bebec23e1f3ce486989bfc9ff3c4e951690df84aa9f926497d82f2ffca9d
+# hadolint ignore=DL3006
+FROM ${IMAGE} AS base
 # We can't reliably pin the package versions on Alpine, so we ignore the linter warning.
 # See https://gitlab.alpinelinux.org/alpine/abuild/-/issues/9996
 # hadolint ignore=DL3018
@@ -24,7 +24,8 @@ COPY src/runner.nim /build/
 COPY src/unittest_json.nim /build/
 RUN /nim/bin/nim c -d:release -d:lto -d:strip /build/runner.nim

-FROM ${REPO}:${IMAGE}
+# hadolint ignore=DL3006
+FROM ${IMAGE}
 COPY --from=nim_builder /nim/ /nim/
 # hadolint ignore=DL3018
 RUN apk add --no-cache \

But that's hardly better, and would bring us to 5 # hadolint ignore comments.

Let's just keep things as they are for now.