Hi All,
I’m new to localstack and I was trying to create and execute a batch job with locakstack docker container by following the documentation: Batch | Docs
The problem I face is that the container spawned by localstack by using my local image is not added to the same user defined network as localstack, as a result I am not able to access any of the resources created using localstack from within this batch container.
Following is my localstack docker compose image :
localstack:
container_name: ${LOCALSTACK_DOCKER_CONTAINER_NAME}
image: localstack/localstack-pro
ports:
- "127.0.0.1:4566:4566" # LocalStack Gateway
- "127.0.0.1:4510-4559:4510-4559" # external services port range
- "127.0.0.1:443:443" # LocalStack HTTPS Gateway (Pro)
environment:
- LOCALSTACK_AUTH_TOKEN=${LOCALSTACK_AUTH_TOKEN} # required for Pro
- DEBUG=1
- services=s3,ssm,dynamodb,sqs,batch,ecr
- LAMBDA_EXECUTOR=local
- DOCKER_HOST=unix:///var/run/docker.sock
- MAIN_DOCKER_NETWORK=local_dev_network
- LOCALSTACK_HOST=localstack:4566
volumes:
- "${LOCALSTACK_VOLUME_DIR:-./volume}:/var/lib/localstack"
- "/var/run/docker.sock:/var/run/docker.sock"
networks:
- local_dev_network
env_file:
- .env
networks:
local_dev_network:
name: local_dev_network
external: false
I tried creating a ecs task / cluster creation using the same localstack service and by following the doc: Elastic Container Service (ECS) | Docs and it was added to the local user defined network . And I could access the localstack resources from within this container.
Any help / inputs on this would be appreciated.
Thanks,
Saurabh M.