Unable to start RabbitMQ docker with SSL cert / key when mounted as a volume #672
-
|
This appears to have been an issue that was opened in the past (#59 & #283) and was subsequently resolved / fixed (#285), however, it seems that a few years back these changes were removed in an effort to simplify the entrypoint script as most of the rabbitmq configuration was moved from Environment Variables to using a configuration file (see https://github.com/docker-library/rabbitmq/pull/467/files#diff-79738685a656fe6b25061bb14181442210b599f746faeaba408a2401de45038aL85). The issue I have is that while I can mount a configuration file and specify the TLS configuration, the problem exists where the SSL certificates that I am attempting to use within the RabbitMQ container are defined on the host and are owned by the root user and thus when RabbitMQ starts, it is unable to access the SSL KEY file as its permissions on the host are 400 root:root. I am not able to change the permissions of this file on the host machine as it is managed by puppet so that it can dynamically define the certificates Subject Alternative Names as the certificate is used for many different things and Puppet will automatically renew the certificate before expiration. With that in mind, I can't rely on a "copy cert into container" and would very much prefer to just mount the certificate and key files into the container with Read Only permissions (as I don't want to allow the container to modify the actual host files since Puppet would detect these changes and rever them) and then as part of the RabbitMQ entrypoint script it could copy these files somewhere else so that they can be owned and accessible to the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
|
Hello and thanks for using RabbitMQ. I'm not convinced that you are unable to change the certificates' permissions via Puppet. Can you provide a concrete example showing why this is not possible? Your best solution at this time is to modify the certificates' permissions, or, copy them to another place that can have the correct permissions (uid 999 / gid 999) so that you can mount them. |
Beta Was this translation helpful? Give feedback.
I'm suggesting that you copy them on the host, not the container. Then set permissions on the host and mount that path.
Please feel free to open a PR and / or provide code that demonstrates this solution. That would go a long way towards convincing me of adding code that would have to be maintained going forward.
@tianon @michaelklishin any thoughts about this?