-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
tech_debtcode for this is fragile and should be fixedcode for this is fragile and should be fixedurgent
Description
What if the user already has something running on 8083?
FIX:
kafka-connect in the docker-compose file should have
ports:
- 8083
so the user's machine would map 8083 inside the container to an available port.
How to get this available port dynamically?
docker inspect kafka-connect prints out the port mappings of the container under NetworkSettings.
Here, my machine has mapped 8083 inside the container to 32791.
I would use localhost:32791 to connect to the container.
"NetworkSettings": {
"Bridge": "",
"SandboxID": "01780fb640723155ae6c80589d773086cc5030f183993e2750d49df93a371d8e",
"HairpinMode": false,
"LinkLocalIPv6Address": "",
"LinkLocalIPv6PrefixLen": 0,
"Ports": {
"8083/tcp": [
{
"HostIp": "0.0.0.0",
"HostPort": "32791"
}
],
"9092/tcp": null
},
You can get this port by running the following command
docker inspect --format='{{(index (index .NetworkSettings.Ports "8083/tcp") 0).HostPort}}' kafka-connect
https://docs.docker.com/engine/reference/commandline/inspect/#find-a-specific-port-mapping
This issue applies for the other hard-coded ports as well.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
tech_debtcode for this is fragile and should be fixedcode for this is fragile and should be fixedurgent
