Skip to content

Commit d0e383a

Browse files
committed
Only update SQLite on PHP 8.3 and later
1 parent 90e7092 commit d0e383a

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/Dockerfile

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,19 @@ RUN curl https://awscli.amazonaws.com/awscli-exe-linux-"$(uname -m)".zip -o "aws
3939
RUN wget https://github.com/mikefarah/yq/releases/download/v4.21.1/yq_linux_"$(dpkg --print-architecture)".tar.gz -O - |\
4040
tar xz && mv yq_linux_"$(dpkg --print-architecture)" /usr/bin/yq
4141

42-
# Upgrade SQLite for Drupal 11 testing.
42+
# Upgrade SQLite 3.x for Drupal 11 testing if CLI version >= 8.3
4343
# @see https://www.drupal.org/project/drupal/issues/3346338
4444
# @see https://github.com/docksal/service-cli/pull/327/files
45-
RUN set -xe; \
45+
# Use the `bc` calculator to compare the PHP version number, removing the `php` prefix.
46+
# Need to get sqlite3 from the Debian testing repository as the default version is too old.
47+
RUN if [ "$(echo "${CLI_VERSION#php} >= 8.3" | bc -l)" -eq 1 ]; then \
48+
set -xe; \
4649
echo "deb https://deb.debian.org/debian testing main" | tee /etc/apt/sources.list.d/testing.list; \
4750
apt-get update >/dev/null; \
48-
apt-get install -y -t testing sqlite3;\
51+
apt-get install -y -t testing sqlite3; \
4952
# Cleanup
50-
apt-get clean; rm -rf /var/lib/apt/lists/*
53+
apt-get clean; rm -rf /var/lib/apt/lists/*; \
54+
fi
5155

5256
# Install expect, vim
5357
RUN apt-get clean && \

0 commit comments

Comments
 (0)