Skip to content
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

LocalStack Dev Services container cannot connect to host network #1161

Open
dabg3 opened this issue Mar 4, 2024 · 3 comments
Open

LocalStack Dev Services container cannot connect to host network #1161

dabg3 opened this issue Mar 4, 2024 · 3 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@dabg3
Copy link

dabg3 commented Mar 4, 2024

I'm leveraging the Quarkus Dev Services feature to start an EventBridge instance when launching my application via mvn quarkus:dev.
The application exposes a REST endpoint which has been set up as API destination in EventBridge, it is associated with a rule so that it gets called when a certain event passes through.

So EventBridge runs in a container, the application on the host.
The problem is that the localstack container has no way to reach the host network, in /etc/hosts there isn't a host.docker.internal entry.
I can't find a way to pass the --add-host flag either, it may be viable via the DOCKER_FLAGS env variable but that cannot be specified on the quarkus extension.

TestContainers allows to expose host ports to the container or to set a different network mode,
is this a missing functionality of the quarkus-extension? or did I overlook something?

@scrocquesel
Copy link
Member

A property could be added to the LocalStackDevServicesBuildTimeConfig configuration

    /**
     * Indicates if the container would make a connection to the host network.
     * {@code Testcontainers.exposeHostPorts(...)} need to be called to define the target port on the host
     */
    @WithDefault("false")
    boolean accessToHost();

And the container can be configured here

Would you mind propose a PR for this and test it with your requirement ?

@dabg3
Copy link
Author

dabg3 commented Mar 5, 2024

Sure! I'll start working on it in a couple of days. Thank you for the inputs

@scrocquesel scrocquesel added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed labels Mar 9, 2024
@scrocquesel
Copy link
Member

I opened a discussion at quarkus quarkusio/quarkus#40573

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants