Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Managed docker network #8412

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed

Managed docker network #8412

wants to merge 3 commits into from

Conversation

simonrw
Copy link
Contributor

@simonrw simonrw commented Jun 1, 2023

This PR allows the user to configure a "managed" docker network.

Putting containers on the same docker network means more straightforward configuration. The containers can make requests to each other using their container names. LocalStack currently adds configuration to allow the user to specify which docker network to add created containers to, for services such as Lambda or ECS. This requires:

  1. the user to be aware of docker networking, and
  2. for them to have set up a network in advance.

Instead, let's make LocalStack the curator of this docker network. On startup, create a named network (if it doesn't exist) and add all containers to it for the user. This means:

  1. the user does not have to know about docker networking, and
  2. they don't have to perform any setup.

Users using docker compose will see the example compose file in the repo and replicate the behaviour in their own compose files.

Implementation

We use the existing configuration variables to control the networks of created containers, and add new configuration to override their behaviour. When the CLI starts up, we create the network if it doesn't exist.

Questions

  • Should we delete the network after the container stops? Probably not, but this is untidy
  • Should we make this behaviour the default in the compose files? I.e. uncomment the USE_MANAGED_DOCKER_NETWORK lines?

@simonrw simonrw added the semver: minor Non-breaking changes which can be included in minor releases, but not in patch releases label Jun 1, 2023
@simonrw simonrw self-assigned this Jun 1, 2023
@coveralls
Copy link

Coverage Status

Coverage: 82.675% (-0.02%) from 82.692% when pulling 0f1b2e0 on managed-docker-network into 55c871f on master.

@github-actions
Copy link

github-actions bot commented Jun 1, 2023

LocalStack Community integration with Pro

2 079 tests   1 784 ✔️  1h 16m 47s ⏱️
       2 suites     282 💤
       2 files         13

For more details on these failures, see this check.

Results for commit 0f1b2e0.

@simonrw simonrw modified the milestones: 3.0, Playground Jul 12, 2023
@simonrw
Copy link
Contributor Author

simonrw commented Aug 25, 2023

Invalidated by #8772

@simonrw simonrw closed this Aug 25, 2023
@alexrashed alexrashed deleted the managed-docker-network branch November 28, 2023 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver: minor Non-breaking changes which can be included in minor releases, but not in patch releases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants