File tree Expand file tree Collapse file tree 2 files changed +25
-1
lines changed
Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Original file line number Diff line number Diff line change 33set -ex
44
55# Arguments: $1 CLI_VERSION
6- docker build --build-arg CLI_VERSION=php" ${1:- 8.0} " -t phase2/docker-cli:php" ${1:- 8.0} " ./src
6+ CLI_VERSION=${1:- 8.3}
7+
8+ # Install SQLite 3.x for Drupal 11 testing if CLI version >= 8.3
9+ INSTALL_SQLITE=false
10+ # Use the `bc` calculator to compare the PHP version number.
11+ if [ " $( echo " ${CLI_VERSION} >= 8.3" | bc -l) " -eq 1 ]; then
12+ INSTALL_SQLITE=true
13+ fi
14+
15+ docker build --build-arg CLI_VERSION=php" $CLI_VERSION " --build-arg INSTALL_SQLITE=" $INSTALL_SQLITE " -t phase2/docker-cli:php" $CLI_VERSION " ./src
Original file line number Diff line number Diff line change @@ -7,6 +7,9 @@ FROM docksal/cli:${CLI_VERSION}
77SHELL ["/bin/bash" , "-o" , "pipefail" , "-c" ]
88
99ARG HELM_VERSION=v2.17.0
10+ # Args defined before the FROM directive are not available in the build stage,
11+ # so cannot test CLI_VERSION directly here.
12+ ARG INSTALL_SQLITE=false
1013
1114# Install kubectl and helm client
1215RUN curl -o /usr/local/bin/kubectl -LO "https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/$(dpkg --print-architecture)/kubectl" && \
@@ -39,6 +42,18 @@ RUN curl https://awscli.amazonaws.com/awscli-exe-linux-"$(uname -m)".zip -o "aws
3942RUN wget https://github.com/mikefarah/yq/releases/download/v4.21.1/yq_linux_"$(dpkg --print-architecture)" .tar.gz -O - |\
4043 tar xz && mv yq_linux_"$(dpkg --print-architecture)" /usr/bin/yq
4144
45+ # Upgrade SQLite 3.x if specified in the build args.
46+ # @see https://www.drupal.org/project/drupal/issues/3346338
47+ # @see https://github.com/docksal/service-cli/pull/327/files
48+ # Need to get sqlite3 from the Debian testing repository as the default version is too old.
49+ RUN if [ "$INSTALL_SQLITE" = "true" ]; then \
50+ set -xe; \
51+ echo "deb https://deb.debian.org/debian testing main" | tee /etc/apt/sources.list.d/testing.list; \
52+ apt-get update >/dev/null; \
53+ apt-get install -y -t testing sqlite3; \
54+ apt-get clean; rm -rf /var/lib/apt/lists/*; \
55+ fi
56+
4257# Install expect, vim
4358RUN apt-get clean && \
4459 apt update && \
You can’t perform that action at this time.
0 commit comments