From 5e422004319c118ced3d343be55ad688141e7484 Mon Sep 17 00:00:00 2001 From: Daniel Dolezal Date: Fri, 17 Apr 2026 09:24:15 +0200 Subject: [PATCH] set docker socket api version for client --- entrypoint-script/entrypoint.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/entrypoint-script/entrypoint.sh b/entrypoint-script/entrypoint.sh index ea789ee..beb8145 100644 --- a/entrypoint-script/entrypoint.sh +++ b/entrypoint-script/entrypoint.sh @@ -88,6 +88,15 @@ function add_docker_socket_permission { usermod -aG "$group_name" "$USER" echo "* Docker socket access granted ($group_name GID=$sock_gid)" + + local server_api + server_api="$(curl -sf --unix-socket /var/run/docker.sock http://localhost/version 2>/dev/null \ + | grep -o '"ApiVersion":"[^"]*"' | cut -d'"' -f4 || true)" + if [ -n "$server_api" ]; then + echo "DOCKER_API_VERSION=$server_api" >> /etc/environment + export DOCKER_API_VERSION="$server_api" + echo "* Docker API version pinned to $server_api" + fi } function make_and_import_ssh_keys {