Closed as not planned
Description
Is there an existing issue for this?
- I have searched the existing issues
Current Behavior
When attempting to mount a shell script (init-aws.sh) as a volume to /etc/localstack/init/ready.d/init-aws.sh
within the LocalStack container (as per the official documentation), Docker creates a directory named init-aws.sh instead of a file.
Expected Behavior
The init-aws.sh script should be successfully mounted into the LocalStack container and executed during startup. This should result in the creation of an S3 bucket and a DynamoDB table as defined in the script.
How are you starting LocalStack?
With a docker-compose file
Steps To Reproduce
- Folder structure
localstack
|_________init-aws.sh
docker-compose.yml
- Run executable command as per documentation
cd localstack
chmod +x init-aws.sh
- Add the following code in
init-aws.sh
file
#!/bin/bash
export AWS_ACCESS_KEY_ID=000000000000 AWS_SECRET_ACCESS_KEY=000000000000
awslocal s3 mb s3://my-bucket
awslocal sqs create-queue --queue-name my-queue
- Add following code in
docker-compose.yml
services:
localstack:
container_name: "localstack-main"
image: localstack/localstack
ports:
- "127.0.0.1:4566:4566"
environment:
- DEBUG=1
volumes:
- "/localstack/init-aws.sh:/etc/localstack/init/ready.d/init-aws.sh"
- "./volume:/var/lib/localstack"
- "/var/run/docker.sock:/var/run/docker.sock"
- Run
docker-compose up
- Inspect the contents of
/etc/localstack/init/ready.d
inside the running LocalStack container (e.g., usingdocker exec -it localstack-main ls -l /etc/localstack/init/ready.d
). You will observe that init-aws.sh is a directory, not a file.
Environment
- OS: Ubuntu 22.04.5
- LocalStack:
LocalStack version: 4.4.1.dev13
LocalStack Docker image sha: sha256:77bb976657d31a9da577b287909dab12dc412a2d7af218caf915be71ab931773
LocalStack build date: 2025-05-14
LocalStack build git hash: 9b6ef35c7
Anything else?
No response