Hi Florian,

ah, sorry, I thought we don't have the IP problem anymore.
You can take a look at [1], the networking class implements auto-discovery of 
the IP address.
Maybe we can find a solution that will reliably determine the IP address for 
Linux as well.

In the meantime, my tip would be to set the environment variable in the IDE so 
you don't have any changes in the source files.

Cheers!
Philipp


Von: Florian Micklich <[email protected]>
Datum: Samstag, 26. November 2022 um 20:17
An: [email protected] <[email protected]>
Betreff: Re: Add functionality of host.docker.internal for linux users?
Hi Philipp,

are you using Linux with the CLI installation? How is here auto discovery 
possible?
So I need to set the SP_HOST variable in my environment or env file. This 
constantly results in a changed file in git that I have to pay attention every 
time I commit, push, ... so I don't accidentally commit it or clash into 
something else.


As it is written here [1] on  Example walkthrough for pipeline-elements-jvm-all 
in IntelliJ:
-> For Linux user: You must change the environment variables stating 
host.docker.internal to you local machine's IP.

So I think this will increase compatibility for Linux users to use the default 
host.docker.internal.

```
>     extra_hosts:<br>
>       - "host.docker.internal:host-gateway"
```

Greetings
Florian

P.S. A short poll, who uses which operating system, would be interesting :-)



[1] https://cwiki.apache.org/confluence/display/STREAMPIPES/Extensions


This is a service that wraps all pipeline elements written with the standard 
Java wrapper, hence the the notion of "jvm-all".

    You should automatically have a run configuration 
"all-pipeline-elements-jvm" as we ship in with the repository
    (Optional) Modifiy environment variables depending on your OS (this is due 
to the dev setup of partly IDE and partly Docker, we need the local services to 
be reachable from within the Docker network)
        For Windows/Mac user: you are good to go
        For Linux user: You must change the environment variables stating 
host.docker.internal to you local machine's IP
    Run the service
    Navigate to "http://localhost:7023/"; to see if the backend is running. You 
should see something similar to the following:

Am Mittwoch, dem 23.11.2022 um 16:50 +0000 schrieb Philipp Zehnder:
> Hi Florian,<br>
>
> what do you need “host.docker.internal” for?<br>
>
> I usually use the auto discovery of the IP address.<br>
> Sometimes, when I change the network, I must restart the backend, but then it 
> will automatically find the correct IP address again.<br>
>
> Cheers,<br>
> Philipp<br>
>
> Von: Florian Micklich <[[email protected]](mailto:[email protected])><br>
> Datum: Dienstag, 22. November 2022 um 18:03<br>
> An: StreanPipes Dev 
> <[[email protected]](mailto:[email protected])><br>
> Betreff: Add functionality of host.docker.internal for linux users?<br>
> Hi,<br>
>
> unlike Windows or Mac, the  host.docker.internal command is not working by 
> default in Linux.<br>
> A solution would be to add following code snippet the the docker-compose 
> files [1].<br>
>
>
> ```<br>
>     extra_hosts:<br>
>       - "host.docker.internal:host-gateway"<br>
> ```<br>
>
> But this requires at least docker version 20.10+.<br>
> I think on our website the required docker version is 1.17.<br>
> Should we take this step and increase the version requirements to add this 
> functionality?<br>
>
>
> Greetings<br>
> Florian<br>
>
> [1] 
> [https://github.com/docker/for-linux/issues/264#issuecomment-784985736](https://github.com/docker/for-linux/issues/264#issuecomment-784985736)<br>

Reply via email to