Skip to content

Commit 4c17e6d

Browse files
authored
Merge pull request #421 from wp-cli/fix/docker-worker-parity
Give the Docker workers the commands and client behaviour of the GitHub runners
2 parents 870c4fb + 1fcb370 commit 4c17e6d

2 files changed

Lines changed: 25 additions & 0 deletions

File tree

‎utils/docker/Dockerfile‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,11 @@ RUN if dpkg --compare-versions "$(dpkg-query -W -f '${Version}' libsqlite3-0)" l
4949
fi
5050

5151
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
52+
53+
# Debian releases before 12 keep commands such as `more` in /bin only, where the GitHub runners
54+
# have them in /usr/bin as well, and scenarios refer to them there.
55+
RUN for command in more; do \
56+
[ -e "/usr/bin/${command}" ] || [ ! -e "/bin/${command}" ] || ln -s "/bin/${command}" "/usr/bin/${command}"; \
57+
done
58+
59+
COPY mariadb /usr/local/bin/mariadb

‎utils/docker/mariadb‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/sh
2+
# MariaDB 11.4 and later warn on STDERR that they cannot verify the certificate of a MySQL server
3+
# when the password does not come from the command line, as with MYSQL_PWD that WP-CLI uses. The
4+
# MySQL client on the GitHub runners does not, so scenarios expecting an empty STDERR would only
5+
# fail in the containers. The server is a throwaway in the worker's own network namespace.
6+
7+
# Options about option files have to come first.
8+
defaults=
9+
while :; do
10+
case "$1" in
11+
--no-defaults|--print-defaults|--defaults-file=*|--defaults-extra-file=*|--defaults-group-suffix=*) defaults="$defaults $1"; shift ;;
12+
*) break ;;
13+
esac
14+
done
15+
16+
# shellcheck disable=SC2086
17+
exec /usr/bin/mariadb $defaults --skip-ssl-verify-server-cert "$@"

0 commit comments

Comments
 (0)