Skip to content

Commit c4fdc92

Browse files
committed
Shrink the images.
- Delete cached files used for installing perl modules. (Saves 650MB!) - Bookworm only: base on the slim-bookworm base image. bookworm before: 1.6GB slim-bookworm: 1.03GB slim-bookworm clean: 572MB The larger image (with a ton of files) takes a long time to download and initialize. (40% of the time to run pause tests in GitHub actions.) A smaller image is faster to download and unpack. There is a tiny chance that someone relying on the new bookworm image is relying on a package that isn't installed by default in the slim images, but the bookworm image has only existed for a week or so, so there are likely to be very few users.
1 parent e05fc97 commit c4fdc92

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

.github/workflows/publish-to-docker.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -98,5 +98,5 @@ jobs:
9898
username: ${{ secrets.DOCKER_USERNAME }}
9999
password: ${{ secrets.DOCKER_GITHUB_TOKEN }}
100100
dockerfile: Dockerfile
101-
buildargs: BASE=${{ matrix.perl-version }}-bookworm,CPANOUTDATED=1
102-
tags: "${{ matrix.perl-version }}-bookworm"
101+
buildargs: BASE=${{ matrix.perl-version }}-slim-bookworm,CPANOUTDATED=1
102+
tags: "${{ matrix.perl-version }}-slim-bookworm"

Dockerfile

+6-3
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,17 @@ RUN perl -V
1010

1111
RUN apt-get update && \
1212
apt-get dist-upgrade -y && \
13-
apt-get -y --no-install-recommends install aspell aspell-en
13+
apt-get -y --no-install-recommends install \
14+
aspell aspell-en \
15+
build-essential \
16+
git
1417

1518
RUN cpanm --self-upgrade || \
1619
( echo "# Installing cpanminus:"; curl -sL https://cpanmin.us/ | perl - App::cpanminus )
1720

18-
RUN cpanm -nq App::cpm Carton::Snapshot
21+
RUN cpanm -nq App::cpm Carton::Snapshot && rm -rf /root/.cpanm
1922

20-
RUN cpm install -g --show-build-log-on-failure --cpanfile /tmp/cpanfile
23+
RUN cpm install -g --show-build-log-on-failure --cpanfile /tmp/cpanfile && rm -rf /root/.perl-cpm
2124

2225
RUN if [ "x${CPANOUTDATED}" = "x1" ] ; then cpan-outdated --exclude-core -p | xargs -n1 cpanm ; else cpan-outdated --exclude-core -p; fi
2326

0 commit comments

Comments
 (0)