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