I am using this RedHat’s Artemis image.
I have a docker-compose.yml
file to run this Artemis container & I try to mount my local ./artemis/broker.xml
to replace the container default one:
version: "3"
services:
artemis:
image: quay.io/artemiscloud/activemq-artemis-broker
user: "root"
environment:
AMQ_USER: admin
AMQ_PASSWORD: admin
AMQ_EXTRA_ARGS: "--relax-jolokia"
AMQ_RESET_CONFIG: true
volumes:
- ./artemis/broker.xml:/home/jboss/broker/etc/broker.xml
ports:
- "5672:5672"
- "61616:61616"
- "8161:8161"
networks:
- backend
...
networks:
backend:
driver: bridge
As you can see above, I am mounting the local ./artemis/broker.xml
to the container path where its default broker.xml
is located. My local directory structure is like this:
docker-compose.yml
artemis/
- broker.xml
I am also using a root
user & have the AMQ_RESET_CONFIG: true
environment variable for the Artemis container.
In my local ./artemis/broker.xml
, the value that differs from the container’s default broker.xml
is this line:
<max-disk-usage>100</max-disk-usage>
The Artemis’ container by default has the value 90
. That’s
<max-disk-usage>90</max-disk-usage>
When I run the container by command docker-compose up --build -d
. The Artemis container is up & running successfully.
But I notice that my local broker.xml
is updated by the container & the value 100
is changed to 90
in my local broker.xml
.
I mean I expected the broker.xml
inside the container should be changed but it behaves completely the other way around that the container changes my local broker.xml
after it is up and running.
Why it behaves like that? How can I have my Artemis container mount my local ./artemis/broker.xml
to replace the container’s default one?