diff --git a/artemis-docker/docker-run.sh b/artemis-docker/docker-run.sh index ba7ee68143..c2b02163d5 100755 --- a/artemis-docker/docker-run.sh +++ b/artemis-docker/docker-run.sh @@ -40,6 +40,9 @@ echo CREATE_ARGUMENTS=${CREATE_ARGUMENTS} if ! [ -f ./etc/broker.xml ]; then /opt/activemq-artemis/bin/artemis create ${CREATE_ARGUMENTS} . + if [ -d ./etc-override ]; then + for file in `ls ./etc-override`; do echo copying file to etc folder: $file; cp ./etc-override/$file ./etc || :; done + fi else echo "broker already created, ignoring creation" fi diff --git a/artemis-docker/readme.md b/artemis-docker/readme.md index 102e7ec695..c245ab32de 100644 --- a/artemis-docker/readme.md +++ b/artemis-docker/readme.md @@ -184,7 +184,14 @@ This will hold the configuration and the data of the running broker. This is use A broker instance will be created during the execution of the instance. If you pass a mapped folder for `/var/lib/artemis-instance` an image will be created or reused depending on the contents of the folder. +# Overriding files in etc folder +You can use customized configuration for the artemis instance by replacing the files residing in `etc` folder with the custom ones, eg. `broker.xml` or `artemis.profile`. Put the replacement files inside a folder and map it as a volume to: +- `/var/lib/artemis-instance/etc-override` + +The contents of `etc-override` folder will be copied over to etc folder after the instance creation. Therefore, the image will always start with user-supplied configuration. + +It you are mapping the whole `var/lib/artemis-instance` to an outside folder for persistence, you can place an `etc-override` folder inside the mapped one, its contents will again be copied over etc folder after creating the instance. ## Running a CentOS image