From c455224ed127ff2885e8b2e08a1fe8cbf4c55a6a Mon Sep 17 00:00:00 2001 From: Harsh Mishra Date: Sun, 18 Oct 2026 09:14:33 +0530 Subject: [PATCH] Export the state in the shutdown hook with Python instead of curl The hook runs inside the LocalStack container, and the LocalStack image no longer ships curl since 2026.10.0, so no pod was exported on shutdown and CI failed at `ls -l volume/my-pod.zip`. Use the image's Python instead. Claude-Session: https://claude.ai/code/session_01DZfDmzUBPqNAu3yFKyfCNM --- example-docker-compose/on-shutdown-hooks/save-pod.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/example-docker-compose/on-shutdown-hooks/save-pod.sh b/example-docker-compose/on-shutdown-hooks/save-pod.sh index 34ef541..4875209 100755 --- a/example-docker-compose/on-shutdown-hooks/save-pod.sh +++ b/example-docker-compose/on-shutdown-hooks/save-pod.sh @@ -2,4 +2,12 @@ # export the state through the LocalStack API # and save it into the localstack volume which is mounted into `./volume`. -curl -sf -o /var/lib/localstack/my-pod.zip http://localhost:4566/_localstack/pods/state +# The LocalStack image does not ship curl, so use its Python. +python3 - <<'PY' +import urllib.request + +opener = urllib.request.build_opener(urllib.request.ProxyHandler({})) +with opener.open("http://localhost:4566/_localstack/pods/state") as response: + with open("/var/lib/localstack/my-pod.zip", "wb") as pod: + pod.write(response.read()) +PY