Can I specify the container name and local port when running app inside docker?

Answered

Other pods may need to connect to the app I am running. Also, it's so annoying to keep changing the setting. It would be great if I can specify them rather than generating them randomly

0
6 comments

Hello, Anthony Yuan Work. Could you please describe your setup in more detail? Where exactly do you expect to specify the port and container name?

0

I am working on a Spring Boot app. I created Run/Debug configuration for it. I set up the “Run on” to use a docker compose target so that I can debug it with several services inside the docker. It can be launched inside the docker and connect to other services properly.

(Reference: https://www.jetbrains.com/help/idea/docker-run-targets.html)

But the app is always binding to a random port and random name. It becomes a challenge for other services to connect to it. I want to know if I can specify the port and container name similar as the Edit Docker Container Settings feature in pycharm: 

https://youtrack.jetbrains.com/issue/PY-23244?_gl=1*37zbsh*_gcl_au*NTgyNDIyNzQyLjE3MjA4MjQ2NjI.*_ga*MTE2MzkwNzM3LjE3MjA4MjAwMjQ.*_ga_9J976DJZ68*MTcyMTA0OTI1OC41LjEuMTcyMTA1MjM1NS42MC4wLjA.

0

It would be great if I can specify them rather than generating them randomly

0

Olga Mulina Please review my question once more; I have included additional details for clarity.

0

Thanks @... ! Just saw your message

0

Please sign in to leave a comment.