You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The docker image I try to slim down contains a service that will try to connect to postgres, kafka etc at startup. If I run the service locally I have postgres and kafka as docker images running locally. Now when I try to slim down the docker container it also needs to connect to these other postgres/kafka containers to be able to start before it's possible to probe the service.
I've tried different combinations with --expose, --publish-port, --new-expose etc, but it doesn't seem to work.
./slim build --show-clogs=true --expose 8088 --http-probe-cmd /actuator/health/readiness --target my-container:1.0.0 --tag mycontainer:slim --publish-port 5432
But the log from the service in my-container say Connection to localhost:5432 refused
So if my-container needs to connect to port 5432 on the host. Is that possible? Which of all parameters should be used for that?
If I would just run my docker container, then something like this works to connect to the correct ports: docker run --network host my-container:1.0.0 so then I tried something like: ./slim build --show-clogs=true --http-probe-cmd /actuator/health/readiness --target my-container:1.0.0 --tag mycontainer:slim --http-probe-ports 8088 --network=host but still not working. Then I get this log:
The docker image I try to slim down contains a service that will try to connect to postgres, kafka etc at startup. If I run the service locally I have postgres and kafka as docker images running locally. Now when I try to slim down the docker container it also needs to connect to these other postgres/kafka containers to be able to start before it's possible to probe the service.
I've tried different combinations with -
-expose, --publish-port, --new-expose
etc, but it doesn't seem to work../slim build --show-clogs=true --expose 8088 --http-probe-cmd /actuator/health/readiness --target my-container:1.0.0 --tag mycontainer:slim --publish-port 5432
But the log from the service in my-container say
Connection to localhost:5432 refused
So if my-container needs to connect to port 5432 on the host. Is that possible? Which of all parameters should be used for that?
If I would just run my docker container, then something like this works to connect to the correct ports:
docker run --network host my-container:1.0.0
so then I tried something like:./slim build --show-clogs=true --http-probe-cmd /actuator/health/readiness --target my-container:1.0.0 --tag mycontainer:slim --http-probe-ports 8088 --network=host
but still not working. Then I get this log:The text was updated successfully, but these errors were encountered: