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

Skip to content

add container port and volume flags to localstack start #9109

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

Merged
merged 1 commit into from
Sep 12, 2023

Conversation

thrau
Copy link
Member

@thrau thrau commented Sep 11, 2023

Motivation

We want to make it easier to add customizations when running localstack start. For instance, to generalize something like DNS_ADDRESS, we could just provide a port mapping for localstack start, that allows people to map, say, 127.0.0.1:1053:53/udp. Similarly, there's now easy way to mount custom volumes into the localstack container other than using DOCKER_FLAGS.

This PR adds a -p and -v flag to localstack start, which are the same as the flags used in docker run. This is a continuation of #8772

Changes

  • Add -p/--publish and -v/--volume flags to localstack start
  • Re-use and refactor the necessary code from dev configurators (was already there) into the bootstrap ContainerConfigurators
  • Fixed an issue where volume parsing wasn't working correctly if :ro suffix was provided
  • Fixed an issue in ports parsing that would prevent a /<protocol> suffix or port range <start>-<end> to be parsed correctly
  • Added a unit test for the configurator

@thrau thrau added the semver: minor Non-breaking changes which can be included in minor releases, but not in patch releases label Sep 11, 2023
@coveralls
Copy link

Coverage Status

coverage: 79.829% (+0.08%) from 79.753% when pulling a0271aa on add-ports-for-cli-start into e2e00c8 on master.

@github-actions
Copy link

LocalStack Community integration with Pro

       2 files         2 suites   1h 18m 57s ⏱️
2 180 tests 1 697 ✔️ 483 💤 0
2 181 runs  1 697 ✔️ 484 💤 0

Results for commit a0271aa.

Copy link
Member

@alexrashed alexrashed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! Great to see the the ContainerConfigurators being adopted, and a new bootstrap test! 🚀
Should there maybe also be a new or enhanced CLI test?

@thrau thrau merged commit dff9c56 into master Sep 12, 2023
@thrau thrau deleted the add-ports-for-cli-start branch September 12, 2023 11:13
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.

3 participants