From bd005ac9c75cc80933f333e26e9245c6a42f8d5f Mon Sep 17 00:00:00 2001 From: Anders Wasen Date: Thu, 17 Sep 2026 14:41:12 +0200 Subject: [PATCH] fix(docker): stop the bundled AWS CLI fetching URL-valued parameters (#3426) The image installs the AWS CLI with pip, which ships only v1, and v1 treats a parameter value that looks like a URL as a pointer to fetch rather than as the value. awscli/paramfile.py reads cli_follow_urlparam with a default of true, so an init hook in /etc/floci/init/ready.d putting an SSM parameter such as MY_API_URL=https://example.com fails with "Unable to retrieve https://example.com", and a hook that backgrounds its calls loses that silently. AWS CLI v2 dropped the behaviour, so this never reproduces when the same script is run from a host with v2 installed, only inside the image. Disabling the setting in the profile the image bakes fixes it for every hook; setting it at runtime does not work, because aws configure set writes to a root-owned file while hooks run after the entrypoint's privilege drop. Mirrored into docker/Dockerfile.jvm-package, whose runtime stage is a copy of this one and is pinned to it by DockerfileRuntimeParityTest. --- docker/Dockerfile | 7 ++++++- docker/Dockerfile.jvm-package | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 3368010e69..2976bc97df 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -37,8 +37,13 @@ RUN set -eux; \ WORKDIR /app +# cli_follow_urlparam: the bundled CLI is v1 (pip ships no v2), where a parameter value that looks +# like a URL is *fetched* and its body used as the value. An init hook putting an SSM parameter such +# as MY_API_URL=https://example.com then fails with "Unable to retrieve https://…", and a hook that +# backgrounds its calls loses that silently. AWS CLI v2 dropped the behaviour, so this only shows up +# in the image, never when the same script is run from a host with v2. RUN mkdir -p /app/data /etc/floci/aws \ - && printf '[default]\nendpoint_url = http://localhost:4566\n' > /etc/floci/aws/config \ + && printf '[default]\nendpoint_url = http://localhost:4566\ncli_follow_urlparam = false\n' > /etc/floci/aws/config \ && chown 1001:root /app \ && chmod "g+rwX" /app \ && chown 1001:root /app/data diff --git a/docker/Dockerfile.jvm-package b/docker/Dockerfile.jvm-package index 8bcc0fcfda..6dacc19a79 100644 --- a/docker/Dockerfile.jvm-package +++ b/docker/Dockerfile.jvm-package @@ -36,8 +36,13 @@ RUN set -eux; \ WORKDIR /app +# cli_follow_urlparam: the bundled CLI is v1 (pip ships no v2), where a parameter value that looks +# like a URL is *fetched* and its body used as the value. An init hook putting an SSM parameter such +# as MY_API_URL=https://example.com then fails with "Unable to retrieve https://…", and a hook that +# backgrounds its calls loses that silently. AWS CLI v2 dropped the behaviour, so this only shows up +# in the image, never when the same script is run from a host with v2. RUN mkdir -p /app/data /etc/floci/aws \ - && printf '[default]\nendpoint_url = http://localhost:4566\n' > /etc/floci/aws/config \ + && printf '[default]\nendpoint_url = http://localhost:4566\ncli_follow_urlparam = false\n' > /etc/floci/aws/config \ && chown 1001:root /app \ && chmod "g+rwX" /app \ && chown 1001:root /app/data