Batch container spawned by localstack isn't added to the same user defined network

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 :

    image: localstack/localstack-pro
      - "" # LocalStack Gateway
      - "" # external services port range
      - "" # LocalStack HTTPS Gateway (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
      - "${LOCALSTACK_VOLUME_DIR:-./volume}:/var/lib/localstack"
      - "/var/run/docker.sock:/var/run/docker.sock"
      - local_dev_network
      - .env

    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.

Saurabh M.

Thank you for bringing this to our attention. We now have a solution in progress. I’ll let you know once the code has been merged.

1 Like

Hi @ssm07 — The fix has been merged! Can you please pull the latest Docker image give it a run once again and let us know if it works fine?

Hi @HarshCasper and @crispinzon ,

I have tested the latest localstack pro image and can confirm that batch job container spawned is now being added to the user defined network.

thanks for the response.

1 Like

Thanks for your feedback. Let us know if you encounter any further LocalStack-specific issues :slight_smile: