I want to make some changes to the config file of the VerneMQ image running on docker. Is there any way to reach the config file so that changes could be made?
3 Answers
If you exec into the container docker exec -it <containerID> bash
, you'll see that the vernemq.conf
file is located under /etc/vermnemq/
. Its just the matter of replacing this default conf by your own config file. Keep your vernemq.conf in same directory as where Dockerfile
is and then add
following line into Dockerfile
COPY vernemq.conf /etc/vernemq/vernemq.conf
The above line copies your config file into container at given location and replaces the existing one. Finally build the image. For more advanced stuff, do checkout this!

- 2,383
- 1
- 29
- 54
Another approach could be to simply set your options as environment variables for the docker image.
From the official docker hub page:
VerneMQ Configuration
All configuration parameters that are available in vernemq.conf can be defined using the DOCKER_VERNEMQ prefix followed by the confguration parameter name. E.g: allow_anonymous=on is -e "DOCKER_VERNEMQ_ALLOW_ANONYMOUS=on" or allow_register_during_netsplit=on is -e "DOCKER_VERNEMQ_ALLOW_REGISTER_DURING_NETSPLIT=on". All available configuration parameters can be found on https://vernemq.com/docs/configuration/.
This is especially useful for compose-like yml-based deployments.

- 955
- 1
- 10
- 25
You can create a new Dockerfile to modify image contents -
FROM erlio/docker-vernemq
RUN Modify Command
Use the new Dockerfile to build new image & run container using that.

- 13,321
- 4
- 55
- 63
-
How do I upload the new Dockerfile? – nr75 Jun 25 '19 at 06:55