I want to spin up a localstack docker container and run a file, create_bucket.sh, with the command
aws --endpoint-url=http://localhost:4566 s3 mb s3://my-bucket
after the container starts. I tried creating this Dockerfile
FROM: localstack/localstack:latest
COPY create_bucket.sh /usr/local/bin/
ENTRYPOINT []
and a docker-compose.yml file that has
version: '3.8'
services:
localstack:
image: localstack/localstack:latest
environment:
...
ports:
- '4566-4583:4566-4583'
command: sh -c "/usr/local/bin/create_bucket.sh"
but when I run
docker-compose up
the container comes up, but the command isn't run. How do I execute my command against the localstack container after container startup?