Docker container startup / shutdown #563
-
I have an issue with the start up of rabbitmq using image rabbitmq:3.10.2-alpine and docker compose. When the container starts, there is a period of about 20 seconds where there are no logs or anything, then "list of feature flags found" log starts and it then takes another 70 seconds to get to "started TCP listener on [::]:5672" So in total taking 90 seconds to startup. If I run rabbitmq outside of the container is takes about 10 seconds to startup. I have also noticed that the normal SIGINT sent by docker stop does not work, but the logs do suggest that the app closes down gracefully when it receives SIGKILL - is this expected and should we always use kill instead of stop? Many thanks |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
Please, always provide the exact commands and files you're using so we won't have to guess how to reproduce your issue. |
Beta Was this translation helpful? Give feedback.
-
@plummyp my colleague @essen figured it out pretty quickly. When you use I fixed the issue in my test environment by adding the following line to
|
Beta Was this translation helpful? Give feedback.
@plummyp my colleague @essen figured it out pretty quickly. When you use
host
networking mode, the containers will be using your host's DNS resolution service. If therabbitmq
hostname does NOT resolve in DNS, you will experience this slow startup.I fixed the issue in my test environment by adding the following line to
/etc/hosts
in the host OS: