title: Setting a policy for RabbitMQ as a part of Dockerfile process
body: <p>I'm trying to make a Dockerfile based on the <a href="https://hub.docker.com/_/rabbitmq/" rel="nofollow">RabbitMQ</a> repository with a customized policy set. The problem is that I can't use<code>CMD</code> or <code>ENTRYPOINT</code> since it will override the base Dockerfile's and then I have to come up with my own and I don't want to go down that path. Let alone the fact if I don't use <code>RUN</code>, it will be a part of run time commands and I want this to be included in the image, not just the container.</p>
  
  <p>Other thing I can do is to use <code>RUN</code> command but the problem with that is the RabbitMQ server is not running at build time and also there's no <code>--offline</code> flag for the <a href="https://www.rabbitmq.com/man/rabbitmqctl.1.man.html#Policy%20Management" rel="nofollow"><code>set_policy</code></a>command of <code>rabbitmqctl</code> program.</p>
  
  <p>When I use docker's <code>RUN</code> command to set the policy, here's the error I face:</p>
  
  <pre><code>Error: unable to connect to node rabbit@e06f5a03fe1f: nodedown
  
  DIAGNOSTICS
  ===========
  
  attempted to contact: [rabbit@e06f5a03fe1f]
  
  rabbit@e06f5a03fe1f:
    * connected to epmd (port 4369) on e06f5a03fe1f
    * epmd reports: node 'rabbit' not running at all
                    no other nodes on e06f5a03fe1f
    * suggestion: start the node
  
  current node details:
  - node name: 'rabbitmq-cli-136@e06f5a03fe1f'
  - home dir: /var/lib/rabbitmq
  - cookie hash: /Rw7u05NmU/ZMNV+F856Fg==
  </code></pre>
  
  <p>So is there any way I can set a policy for the RabbitMQ without writing my own version of <code>CMD</code> and/or <code>ENTRYPOINT</code>?</p>