Skip to content

Commit 73efa44

Browse files
Remove all Ruby versions whose base image is based on Debian Jessie (8) or Stretch (9)
It also allowed to remove: * many edge cases in Alpine-based variants * many dirty hacks related to archived/removed/unsigned APT repositories The Debian version used by each base image has been determined with the following script: ```shell RUBY_VERSIONS=$(echo \ 2.3.{1,2,3,4,5,6,7,8} \ 2.4.{0,1,2,3,4,5,6,7,8,9,10} \ 2.5.{0,1,3,4,5,6,7,8,9} \ 2.6.{0,1,2,3,4,5,6,7,8,9,10} \ 2.7.{0,1,2,3,4,5,6,7,8} \ 3.0.{0,1,2,3,4,5,6,7} \ 3.1.{0,1,2,3,4,5,6,7} \ 3.2.{0,1,2,3,4,5,6,7,8} \ 3.3.{0,1,2,3,4,5,6,7,8} \ 3.4.{1,2} \ ) for version in $RUBY_VERSIONS; do docker pull ruby:${version} docker pull ruby:${version}-alpine done for version in $RUBY_VERSIONS; do debianVersion=$(docker run ruby:${version} sed -n 's/^VERSION=\"[0-9]\+ (\(.*\))\"$/\1/p' /etc/os-release) alpineVersion=$(docker run ruby:${version}-alpine sed -nr 's/^VERSION_ID=(\d+\.\d+).*/\1/p' /etc/os-release) echo -e "${version}\t${debianVersion}\t${alpineVersion}"; done ``` Which outputs the following list (formatted as a Unicode table for more readability): ┌────────┬──────────┬────────┐ │ Ruby │ Debian │ Alpine │ ├────────┼──────────┼────────┤ │ 2.3.1 │ jessie │ 3.4 │ │ 2.3.2 │ jessie │ 3.4 │ │ 2.3.3 │ jessie │ 3.4 │ │ 2.3.4 │ jessie │ 3.4 │ │ 2.3.5 │ jessie │ 3.4 │ │ 2.3.6 │ jessie │ 3.4 │ │ 2.3.7 │ stretch │ 3.8 │ │ 2.3.8 │ stretch │ 3.8 │ │ 2.4.0 │ jessie │ 3.4 │ │ 2.4.1 │ jessie │ 3.4 │ │ 2.4.2 │ jessie │ 3.4 │ │ 2.4.3 │ jessie │ 3.4 │ │ 2.4.4 │ stretch │ 3.7 │ │ 2.4.5 │ stretch │ 3.9 │ │ 2.4.6 │ buster │ 3.10 │ │ 2.4.7 │ buster │ 3.10 │ │ 2.4.8 │ buster │ 3.10 │ │ 2.4.9 │ buster │ 3.11 │ │ 2.4.10 │ buster │ 3.11 │ │ 2.5.0 │ stretch │ 3.7 │ │ 2.5.1 │ stretch │ 3.7 │ │ 2.5.3 │ stretch │ 3.9 │ │ 2.5.4 │ stretch │ 3.9 │ │ 2.5.5 │ buster │ 3.10 │ │ 2.5.6 │ buster │ 3.10 │ │ 2.5.7 │ buster │ 3.11 │ │ 2.5.8 │ buster │ 3.13 │ │ 2.5.9 │ buster │ 3.13 │ │ 2.6.0 │ stretch │ 3.8 │ │ 2.6.1 │ stretch │ 3.9 │ │ 2.6.2 │ stretch │ 3.9 │ │ 2.6.3 │ buster │ 3.10 │ │ 2.6.4 │ buster │ 3.10 │ │ 2.6.5 │ buster │ 3.11 │ │ 2.6.6 │ buster │ 3.13 │ │ 2.6.7 │ buster │ 3.13 │ │ 2.6.8 │ bullseye │ 3.14 │ │ 2.6.9 │ bullseye │ 3.15 │ │ 2.6.10 │ bullseye │ 3.15 │ │ 2.7.0 │ buster │ 3.11 │ │ 2.7.1 │ buster │ 3.12 │ │ 2.7.2 │ buster │ 3.13 │ │ 2.7.3 │ buster │ 3.13 │ │ 2.7.4 │ bullseye │ 3.14 │ │ 2.7.5 │ bullseye │ 3.15 │ │ 2.7.6 │ bullseye │ 3.16 │ │ 2.7.7 │ bullseye │ 3.16 │ │ 2.7.8 │ bullseye │ 3.16 │ │ 3.0.0 │ buster │ 3.13 │ │ 3.0.1 │ buster │ 3.13 │ │ 3.0.2 │ bullseye │ 3.14 │ │ 3.0.3 │ bullseye │ 3.15 │ │ 3.0.4 │ bullseye │ 3.16 │ │ 3.0.5 │ bullseye │ 3.16 │ │ 3.0.6 │ bullseye │ 3.16 │ │ 3.0.7 │ bullseye │ 3.16 │ │ 3.1.0 │ bullseye │ 3.15 │ │ 3.1.1 │ bullseye │ 3.15 │ │ 3.1.2 │ bullseye │ 3.16 │ │ 3.1.3 │ bullseye │ 3.17 │ │ 3.1.4 │ bookworm │ 3.19 │ │ 3.1.5 │ bookworm │ 3.20 │ │ 3.1.6 │ bookworm │ 3.21 │ │ 3.1.7 │ bookworm │ 3.21 │ │ 3.2.0 │ bullseye │ 3.17 │ │ 3.2.1 │ bullseye │ 3.17 │ │ 3.2.2 │ bookworm │ 3.19 │ │ 3.2.3 │ bookworm │ 3.19 │ │ 3.2.4 │ bookworm │ 3.20 │ │ 3.2.5 │ bookworm │ 3.20 │ │ 3.2.6 │ bookworm │ 3.21 │ │ 3.2.7 │ bookworm │ 3.21 │ │ 3.2.8 │ bookworm │ 3.21 │ │ 3.3.0 │ bookworm │ 3.19 │ │ 3.3.1 │ bookworm │ 3.20 │ │ 3.3.2 │ bookworm │ 3.20 │ │ 3.3.3 │ bookworm │ 3.20 │ │ 3.3.4 │ bookworm │ 3.20 │ │ 3.3.5 │ bookworm │ 3.20 │ │ 3.3.6 │ bookworm │ 3.21 │ │ 3.3.7 │ bookworm │ 3.21 │ │ 3.3.8 │ bookworm │ 3.21 │ │ 3.4.1 │ bookworm │ 3.21 │ │ 3.4.2 │ bookworm │ 3.21 │ └────────┴──────────┴────────┘
1 parent 8ee4125 commit 73efa44

File tree

2 files changed

+6
-63
lines changed

2 files changed

+6
-63
lines changed

.github/workflows/docker-build.yml

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -66,61 +66,18 @@ jobs:
6666
- 2.6.5
6767
- 2.6.4
6868
- 2.6.3
69-
- 2.6.2
70-
- 2.6.1
71-
- 2.6.0
7269
- 2.5.9
7370
- 2.5.8
7471
- 2.5.7
7572
- 2.5.6
7673
- 2.5.5
77-
- 2.5.4
78-
- 2.5.3
79-
# Ruby 2.5.2 never existed: it was mis-packaged and 2.5.3 was released immediately to fix it
80-
- 2.5.1
81-
- 2.5.0
8274
- 2.4.10
8375
- 2.4.9
8476
- 2.4.8
8577
- 2.4.7
8678
- 2.4.6
87-
- 2.4.5
88-
- 2.4.4
89-
- 2.4.3
90-
- 2.4.2
91-
- 2.4.1
92-
- 2.4.0
93-
- 2.3.8
94-
- 2.3.7
95-
- 2.3.6
96-
- 2.3.5
97-
- 2.3.4
98-
- 2.3.3
99-
- 2.3.2
100-
- 2.3.1
10179
variant: ["", "-alpine"]
10280

103-
exclude:
104-
# the following needs an explicit Alpine version, so we exlude them here and re-include them with explicit version below
105-
- { ruby: 2.4.3, variant: "-alpine" }
106-
- { ruby: 2.4.2, variant: "-alpine" }
107-
- { ruby: 2.4.1, variant: "-alpine"}
108-
# the following do not have an Alpine variant because Yarn is unavailable on their base Alpine version (< 3.6)
109-
- { ruby: 2.4.0, variant: "-alpine" }
110-
- { ruby: 2.3.6, variant: "-alpine" }
111-
- { ruby: 2.3.5, variant: "-alpine" }
112-
- { ruby: 2.3.4, variant: "-alpine" }
113-
- { ruby: 2.3.3, variant: "-alpine" }
114-
- { ruby: 2.3.2, variant: "-alpine" }
115-
- { ruby: 2.3.1, variant: "-alpine" }
116-
117-
include:
118-
- ruby: 2.4.3
119-
variant: "-alpine3.7"
120-
- ruby: 2.4.2
121-
variant: "-alpine3.7"
122-
- ruby: 2.4.1
123-
variant: "-alpine3.6"
12481
steps:
12582
-
12683
name: Login to Docker Hub
@@ -143,14 +100,12 @@ jobs:
143100
${{ startsWith(matrix.ruby, '2.6') && 'RUBYGEMS_VERSION_ARG=3.4.22' || '' }}
144101
${{ startsWith(matrix.ruby, '2.5') && 'RUBYGEMS_VERSION_ARG=3.3.26' || '' }}
145102
${{ startsWith(matrix.ruby, '2.4') && 'RUBYGEMS_VERSION_ARG=3.3.26' || '' }}
146-
${{ startsWith(matrix.ruby, '2.3') && 'RUBYGEMS_VERSION_ARG=3.3.26' || '' }}
147103
148104
${{ startsWith(matrix.ruby, '3.0') && 'BUNDLER_VERSION_ARG=2.5.23' || '' }}
149105
${{ startsWith(matrix.ruby, '2.7') && 'BUNDLER_VERSION_ARG=2.4.22' || '' }}
150106
${{ startsWith(matrix.ruby, '2.6') && 'BUNDLER_VERSION_ARG=2.4.22' || '' }}
151107
${{ startsWith(matrix.ruby, '2.5') && 'BUNDLER_VERSION_ARG=2.3.26' || '' }}
152108
${{ startsWith(matrix.ruby, '2.4') && 'BUNDLER_VERSION_ARG=2.3.26' || '' }}
153-
${{ startsWith(matrix.ruby, '2.3') && 'BUNDLER_VERSION_ARG=2.3.26' || '' }}
154109
155110
tags: |
156111
alpinelab/ruby-dev:${{ matrix.ruby }}${{ matrix.variant }}
@@ -167,11 +122,6 @@ jobs:
167122
${{ matrix.ruby == '2.6.10' && format('alpinelab/ruby-dev:2.6{0}', matrix.variant) || '' }}
168123
${{ matrix.ruby == '2.5.9' && format('alpinelab/ruby-dev:2.5{0}', matrix.variant) || '' }}
169124
${{ matrix.ruby == '2.4.10' && format('alpinelab/ruby-dev:2.4{0}', matrix.variant) || '' }}
170-
${{ matrix.ruby == '2.3.8' && format('alpinelab/ruby-dev:2.3{0}', matrix.variant) || '' }}
171-
172-
${{ (matrix.ruby == '2.4.3' && matrix.variant == '-alpine3.7') && 'alpinelab/ruby-dev:2.4.3-alpine' || '' }}
173-
${{ (matrix.ruby == '2.4.2' && matrix.variant == '-alpine3.7') && 'alpinelab/ruby-dev:2.4.2-alpine' || '' }}
174-
${{ (matrix.ruby == '2.4.3' && matrix.variant == '-alpine3.6') && 'alpinelab/ruby-dev:2.4.1-alpine' || '' }}
175125
176126
cache-from: type=gha
177127
cache-to: type=gha,mode=max

Dockerfile

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ ARG RUBYGEMS_VERSION_ARG="" \
1414
BUNDLER_VERSION_ARG=""
1515

1616
# Define dependencies base versions
17-
# Note: NodeJS is capped to 14.x on Jessie and 16.x on Stretch (due to `libc` requirements)
1817
ENV NODE_VERSION="20" \
1918
GOSU_VERSION="1.17"
2019

@@ -41,7 +40,7 @@ RUN set -eux; \
4140
# Use `libpq-dev` (~20MB) rather than `postgresql-dev` (~200MB) if available
4241
# (the former was extracted from the latter in Alpine 3.15)
4342
case ${alpineMajorVersion} in \
44-
3.3|3.4|3.5|3.6|3.7|3.8|3.9|3.10|3.11|3.12|3.13|3.14) libpqPackage="postgresql-dev" ;; \
43+
3.10|3.11|3.12|3.13|3.14) libpqPackage="postgresql-dev" ;; \
4544
3.15|*) libpqPackage="libpq-dev" ;; \
4645
esac; \
4746
\
@@ -60,11 +59,10 @@ RUN set -eux; \
6059
;; \
6160
\
6261
debian|ubuntu) \
63-
# Fix Jessie & Stretch APT sources (they have been moved to http://archive.debian.org)
62+
# Fix Buster APT sources (they have been moved to http://archive.debian.org)
6463
if [ -f /etc/apt/sources.list ]; then \
6564
sed -i -r \
66-
-e '/(jessie|stretch)[-\/]updates/d' \
67-
-e 's|http://(deb\|httpredir).debian.org/debian (jessie\|stretch)|http://archive.debian.org/debian \2|' \
65+
-e 's|http://(deb\|httpredir).debian.org/debian (buster)|http://archive.debian.org/debian \2|' \
6866
/etc/apt/sources.list; \
6967
fi; \
7068
\
@@ -78,11 +76,10 @@ RUN set -eux; \
7876
\
7977
# Fix LetsEncrypt expired CA on older Debian releases
8078
case ${debianReleaseCodename} in \
81-
jessie|buster|stretch) \
79+
buster) \
8280
apt-get install --assume-yes --no-install-recommends --no-install-suggests --force-yes \
8381
ca-certificates \
8482
curl \
85-
$([ "${debianReleaseCodename}" = "jessie" ] && echo "libssl1.0.0") \
8683
; \
8784
sed -i 's|mozilla/DST_Root_CA_X3.crt|!mozilla/DST_Root_CA_X3.crt|g' /etc/ca-certificates.conf; \
8885
update-ca-certificates; \
@@ -92,16 +89,12 @@ RUN set -eux; \
9289
# Add PostgreSQL APT repository
9390
curl -sSL https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor > /etc/apt/trusted.gpg.d/apt.postgresql.org.gpg; \
9491
case ${debianReleaseCodename} in \
95-
jessie|stretch|buster) echo "deb https://apt-archive.postgresql.org/pub/repos/apt ${debianReleaseCodename}-pgdg-archive main" ;; \
92+
buster) echo "deb https://apt-archive.postgresql.org/pub/repos/apt ${debianReleaseCodename}-pgdg-archive main" ;; \
9693
*) echo "deb https://apt.postgresql.org/pub/repos/apt/ ${debianReleaseCodename}-pgdg main" ;; \
9794
esac > /etc/apt/sources.list.d/pgdg.list; \
9895
\
9996
# Add NodeJS APT repository
100-
case ${debianReleaseCodename} in \
101-
jessie) curl -fsSL https://deb.nodesource.com/setup_14.x ;; \
102-
stretch) curl -fsSL https://deb.nodesource.com/setup_16.x ;; \
103-
*) curl -fsSL https://deb.nodesource.com/setup_${NODE_VERSION}.x ;; \
104-
esac | bash; \
97+
curl -fsSL https://deb.nodesource.com/setup_${NODE_VERSION}.x | bash; \
10598
\
10699
# Install everything
107100
apt-get update; \

0 commit comments

Comments
 (0)