Trying to setup LocalStack for local development in a project that will be using aws services down the line. Trying to set it up for s3 and sqs, but it fails during setup.
I used this example for docker compose as a template, but still cannot get it to work. https://docs.localstack.cloud/references/init-hooks/#usage-example
Running on a Windows machine, using Docker Desktop.
Here is the log from inside the localstack container.
docker-compose.yml
version: '3.8'
name: test
services:
localstack:
container_name: "${LOCALSTACK_DOCKER_NAME:-localstack-main}"
image: localstack/localstack:latest
command: chmod +x /etc/localstack/init/ready.d/init-localstack.sh
ports:
- "4566:4566"
environment:
- DEBUG=1
volumes:
- "./init-localstack.sh:/etc/localstack/init/ready.d/init-localstack.sh"
- "${LOCALSTACK_VOLUME_DIR:-./volume}:/var/lib/localstack"
- "/var/run/docker.sock:/var/run/docker.sock"
init-localstack.sh
#!/bin/bash
awslocal s3 mb s3://my-bucket
awslocal sqs create-queue --queue-name my-queue
- The file does appear inside the container, and i can run it manually there.
- I have tried with #!/bin/sh as well, still gets the same issue.
- Both sh and bash is in bin.
- I have checked that there are only LF and no CRLF in the shell file
- The command in compose file is trying to make sure that execute permission is there.
This seems like such a basic copy paste from the example in the docs, so its odd to me that the shell file cannot be executed.
I know I can get it to work by running commands from within the container manually, but this is not viable at scale, so would want it to work via compose.