Skip to content

docker-entrypoint.sh attempts to overwrite my config file #191

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
streamliner18 opened this issue Sep 17, 2017 · 2 comments
Closed

docker-entrypoint.sh attempts to overwrite my config file #191

streamliner18 opened this issue Sep 17, 2017 · 2 comments

Comments

@streamliner18
Copy link

I'm trying to create my own rabbitmq Dockerfile with custom configurations and definitions baked in the container. (COPY'ed directly into /etc/rabbitmq/rabbitmq.config) When I start the container, it gives me this:

/usr/local/bin/docker-entrypoint.sh: line 386: /etc/rabbitmq/rabbitmq.config: Permission denied.

I then tried to add RUN chmod 777 /etc/rabbitmq/rabbitmq.config to my Dockerfile, it did run. However, it simply overwrote my rabbitmq.config with the default one, and non of my settings were properly applied.

Reproduced on 17.06.2-ce and rabbitmq:3.6.11, both on a macOS 10.12 and a Ubuntu 16.04 box. I verified the overwrite by manually attaching bash into the container and cat-ing the config.

Here's my Dockerfile:

FROM rabbitmq:3.6.11

MAINTAINER Project Wyze Team

COPY rabbitmq_message_timestamp.ez /usr/lib/rabbitmq/lib/rabbitmq_server-3.6.11/plugins/

COPY rabbitmq.config /etc/rabbitmq/
COPY definitions.json /etc/rabbitmq/

RUN chmod +r /etc/rabbitmq/rabbitmq.config

RUN rabbitmq-plugins enable --offline rabbitmq_management
RUN rabbitmq-plugins enable --offline rabbitmq_mqtt
RUN rabbitmq-plugins enable --offline rabbitmq_message_timestamp

ENV RABBITMQ_HIPE_COMPILE 1

EXPOSE 15672
EXPOSE 1883

And here's my section of docker-compose:

services:
    rabbit:
        build: ./rabbit-mqtt
        ports:
            - "15672:15672"
            - "5672:5672"
            - "1883:1883"
@yosifkit
Copy link
Member

I think this comment is partly applicable. Basically, you should set the hipe_compile option in your config file and remove the ENV, and then the entrypoint script will no longer try to overwrite your config.

@streamliner18
Copy link
Author

@yosifkit Bingo! Thanks man, that's exactly the problem! Actually it would be great if this behavior is properly documented on the docker hub page. I'll try to PR this later.

streamliner18 added a commit to streamliner18/ProjectWyze that referenced this issue Sep 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants