Skip to content

Commit 8b8aa91

Browse files
committed
Dockerfile: use alpine as base image
- We require bash-5.3, and the debian base image only provides up to bash-5.2. Alpine provides bash-5.3, so switch to that. - It is also smaller, which is a nice bonus. - Also disabled git safe-directory check, as I don't think any usage of this image would involve untrusted repositories, so this is just an annoyance. When we have python docker images based on newer debian with bash-5.3, we can consider switching back to debian, or even giving users a choice between debian and alpine based images. Resolves: pkgcore/pkgcheck-action#21 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
1 parent f78f047 commit 8b8aa91

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

Dockerfile

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
FROM python:3-slim
1+
FROM python:3-alpine
22
ARG PKGCHECK_VERSION
33

4-
RUN apt-get update && apt-get install -y --no-install-recommends git zstd cpanminus make && \
4+
RUN apk add --no-cache "bash>=5.3" git perl xz zstd && \
5+
apk add --no-cache --virtual .cpanm make perl-app-cpanminus && \
56
cpanm --quiet --notest Gentoo::PerlMod::Version && \
6-
apt remove --autoremove -y make cpanminus && \
7-
rm -rf /var/lib/apt/lists/ /var/cache/apt /var/cache/dpkg && \
8-
pip install pkgcheck==${PKGCHECK_VERSION} setuptools requests && \
9-
pip cache purge
7+
apk del .cpanm make perl-app-cpanminus && \
8+
pip install --root-user-action=ignore pkgcheck==${PKGCHECK_VERSION} setuptools requests && \
9+
pip cache purge && \
10+
ln -sv /bin/bash /usr/bin/bash && \
11+
git config --global --add safe.directory '*'

0 commit comments

Comments
 (0)