enable ssl on docker image library/rabbitmq:3.5.7-management

2,678 views
Skip to first unread message

g

unread,
Jan 14, 2016, 10:27:14 AM1/14/16
to rabbitmq-users
Can anyone help me configure ssl on the docker image?

I am using library/rabbitmq:3.5.7-management at the moment but the version isn't important if it matters.

I am trying to host rabbitmq on aws using a docker elastic beanstalk environment.  I cannot figure out how to configure the container to use ssl.

I've tried setting environment variables and I also tried overriding the config file and since neither is working I am guessing I am doing something wrong.

Can anyone share a working or demonstrate how to configure the docker container using docker-compose or Dockerrun.aws.json (I am using aws for hosting this container)

Thanks!

Jean-Sébastien Pédron

unread,
Jan 14, 2016, 12:46:27 PM1/14/16
to rabbitm...@googlegroups.com
On 14/01/2016 16:27, g wrote:
> Can anyone help me configure ssl on the docker image?

Hi!

You may want to look at this pull request which was accepted:
https://github.com/docker-library/rabbitmq/pull/49

I don't know how to use Docker, but the docker-entrypoint.sh script
requires the following environment variables to enable SSL:
o $RABBITMQ_SSL_CERT_FILE
o $RABBITMQ_SSL_KEY_FILE
o $RABBITMQ_SSL_CA_FILE

Note that the variables are named "RABBITMQ_", not "RABBIT_" as the
first comment suggests.

--
Jean-Sébastien Pédron
Pivotal / RabbitMQ

g

unread,
Jan 14, 2016, 1:11:32 PM1/14/16
to rabbitmq-users, jean-se...@rabbitmq.com
Awesome!! I didn't see that.  Thanks so much.  It should solve my problems.  I will report back if there are any more troubles

g

unread,
Jan 14, 2016, 2:19:09 PM1/14/16
to rabbitmq-users, jean-se...@rabbitmq.com
That got me going but I've hit an issue where rabbitmq in the container will segfault when it drops root (I am assuming this where the permissions error is coming from) and then cannot open the key/cert/cafile due to restrictive 0400 permissions on the host.

Right now the immediate workaround is to use 0777 permissions on the host machine but that is dangerous.

https://github.com/docker-library/rabbitmq/issues/59

Deepshikha Singh

unread,
May 31, 2016, 1:39:20 PM5/31/16
to rabbitmq-users, jean-se...@rabbitmq.com
Hi, 

So I am trying to run the rabbitmq docker image as 

docker run -it \
  --hostname my-rabbitmq \
  --name ssl-rabbit \
  -p 5671:5671 \
  -p 15671:15671 \
  -e RABBITMQ_SSL_CERT_FILE=/local/path/to/cert.pem \
  -e RABBITMQ_SSL_KEY_FILE=/local/path/to/key.pem \
  -e RABBITMQ_SSL_CA_FILE=/local/path/to/cacert.pem \
  rabbitmq

The local paths are local to my host. Is this supposed to be a path on rabbitmq? I get the error cannot find these files

Jean-Sébastien Pédron

unread,
Jun 1, 2016, 4:37:40 AM6/1/16
to rabbitm...@googlegroups.com
On 31/05/2016 19:39, Deepshikha Singh wrote:
> Hi,

Hi!

> So I am trying to run the rabbitmq docker image as
>
> docker run -it \
> --hostname my-rabbitmq \
> --name ssl-rabbit \
> -p 5671:5671 \
> -p 15671:15671 \
> -e RABBITMQ_SSL_CERT_FILE=/local/path/to/cert.pem \
> -e RABBITMQ_SSL_KEY_FILE=/local/path/to/key.pem \
> -e RABBITMQ_SSL_CA_FILE=/local/path/to/cacert.pem \
> rabbitmq
>
> The local paths are local to my host. Is this supposed to be a path on
> rabbitmq? I get the error cannot find these files

Those files must be reachable from the container and thus, the path must
be the one in it, not the one on the host.
Reply all
Reply to author
Forward
0 new messages