···
# syntax=docker/dockerfile:1
2
-
FROM ghcr.io/hadolint/hadolint:latest-alpine AS hadolint-binary
# Since we're building against edge at risk, it is important to note
# that anything might go wrong.
FROM alpine:edge AS buildkit
# Since hadolint isn't in the package repos for Alpine yet, we'll copying from the offical
10
-
COPY --from=hadolint-binary /bin/hadolint /usr/bin/hadolint
8
+
COPY --from=ghcr.io/hadolint/hadolint:latest-alpine /bin/hadolint /usr/bin/hadolint
ENV PACKAGES=/usr/local/lib/python3.11/site-packages
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/root/.local/bin
ENV PYTHONDONTWRITEBYTECODE=1
15
-
COPY --from=hadolint-binary /bin/hadolint /usr/bin/hadolint
# https://squidfunk.github.io/mkdocs-material/setup/setting-up-social-cards/#linux but for Alpine
15
+
# Also installs Doppler CLI for accessing secrets securely within CI
# hadolint ignore=DL3018,DL3013
···
&& curl -Ls --tlsv1.2 --proto "=https" --retry 3 https://cli.doppler.com/install.sh \
46
-
# The "--break-system-packages" is added so I don't need to do requirements.txt workaround,
47
-
# although I also consider using pipx if we wanted to.
48
-
# See also https://www.jeffgeerling.com/blog/2023/how-solve-error-externally-managed-environment-when-installing-pip3
47
+
# See https://www.jeffgeerling.com/blog/2023/how-solve-error-externally-managed-environment-when-installing-pip3
48
+
# for context behind removing the EXTERNALLY-MANAGED file
RUN rm -rv /usr/lib/python3*/EXTERNALLY-MANAGED \
&& pip install --no-cache \