[
  {
    "path": ".travis.yml",
    "content": "language: bash\nservices: docker\n\nenv:\n  - VERSION=1.0.0\n  - VERSION=1.0.0 VARIANT=alpine\n  - VERSION=1.1.0\n  - VERSION=1.1.0 VARIANT=alpine\n  - VERSION=1.2.0 \n  - VERSION=1.2.0 VARIANT=alpine\n  - VERSION=1.3.0 \n  - VERSION=1.3.0 VARIANT=alpine\n  - VERSION=1.4.0 \n  - VERSION=1.4.0 VARIANT=alpine\n  - VERSION=1.5.0\n  - VERSION=1.5.0 VARIANT=alpine \n  - VERSION=1.5.1\n  - VERSION=1.5.1 VARIANT=alpine\n  - VERSION=1.5.2\n  - VERSION=1.5.2 VARIANT=alpine\n  - VERSION=1.5.3\n  - VERSION=1.5.3 VARIANT=alpine\n  - VERSION=1.5.4\n  - VERSION=1.5.4 VARIANT=alpine\n  - VERSION=1.5.5\n  - VERSION=1.5.5 VARIANT=alpine\n  - VERSION=1.5.6 \n  - VERSION=1.5.6 VARIANT=alpine\n  - VERSION=2.0.0 \n  - VERSION=2.0.0 VARIANT=alpine\n  - VERSION=2.1.0 \n  - VERSION=2.1.0 VARIANT=alpine\n  - VERSION=2.2.0 \n  - VERSION=2.2.0 VARIANT=alpine\n  - VERSION=2.3.0 \n  - VERSION=2.3.0 VARIANT=alpine\n  - VERSION=2.4.0 \n  - VERSION=2.4.0 VARIANT=alpine\n  - VERSION=2.5.0 \n  - VERSION=2.5.0 VARIANT=alpine\n  - VERSION=2.6.0\n  - VERSION=2.6.0 VARIANT=alpine\n  - VERSION=2.6.1\n  - VERSION=2.6.1 VARIANT=alpine\n  - VERSION=2.6.2\n  - VERSION=2.6.2 VARIANT=alpine    \n  - VERSION=2.6.3 \n  - VERSION=2.6.3 VARIANT=alpine\n  - VERSION=2.7.0 \n  - VERSION=2.7.0 VARIANT=alpine\n  - VERSION=2.8.0 \n  - VERSION=2.8.0 VARIANT=alpine\n  - VERSION=2.9.0 \n  - VERSION=2.9.0 VARIANT=alpine\n  - VERSION=2.10.0\n  - VERSION=2.10.0 VARIANT=alpine\n  - VERSION=2.10.1 \n  - VERSION=2.10.1 VARIANT=alpine\n  - VERSION=2.11.0 \n  - VERSION=2.11.0 VARIANT=alpine\n  - VERSION=2.12.0 \n  - VERSION=2.12.0 VARIANT=alpine\n  - VERSION=2.13.0 \n  - VERSION=2.13.0 VARIANT=alpine\n  - VERSION=2.14.0 \n  - VERSION=2.14.0 VARIANT=alpine\n  - VERSION=2.15.0\n  - VERSION=2.15.0 VARIANT=alpine\n  - VERSION=2.16.0\n  - VERSION=2.16.0 VARIANT=alpine\n\nbefore_install:\n  - curl -L https://goss.rocks/install | sudo sh\n\ninstall:\n  - git clone https://github.com/vromero/activemq-artemis-docker.git ~/activemq-artemis-docker\n\nbefore_script:\n  - versionTag=\"${VERSION}${VARIANT:+-${VARIANT}}\"\n  - if [[ $TRAVIS_PULL_REQUEST == \"false\" ]] && [[ $TRAVIS_BRANCH == \"master\" ]]; then echo \"$DOCKER_PASSWORD\" | docker login -u \"$DOCKER_USERNAME\" --password-stdin; fi\n\nscript:\n  - |\n    (\n      set -Eeuo pipefail\n      set -x\n      travis_retry make $versionTag \n      echo ---------------------------\n      echo $TRAVIS_PULL_REQUEST\n      echo $TRAVIS_BRANCH\n      echo ---------------------------\n      if [[ $TRAVIS_PULL_REQUEST == \"false\" ]] && [[ $TRAVIS_BRANCH == \"master\" ]]; then travis_retry make push_$versionTag; fi\n    )\n\n"
  },
  {
    "path": "BUILD.md",
    "content": "# Building the ActiveMQ Artemis Docker Image\n\nDepending on your platform the build process may differ slightly. Support for as many build platforms as possible is provided in a best effort basis.\n\nIf you consistently can reproduce a test failure, please search for it in the [issue tracker](https://github.com/vromero/activemq-artemis-docker/issues) or file a new issue.\n\n## Prerequisites\n\nTo build the ActiveMQ Artemis Docker Image the following tools are necessary:\n\n- Docker\n- Make\n- goss and dgoss\n- shellcheck\n- bats-core\n\n## Supported Platforms\n\nOnly UN*X based operating systems are supported currently for building this image. \n\n## Building the image\n\nTo build all versions running all tests jus type\n\n```bash\nmake\n```\n\nThis will run the full build (with the exception of the deployment phase) for all versions presents in the filel `tags.csv`.\n\nTo just build *just one version* you can call `make` with `VERSION[-VARIANT]` where variant can be `-alpine` for an Alpine based image build or just nothing for a Debian based one, e.g:\n\n```bash\nmake 2.6.0\n```\n\n```bash\nmake 2.6.0-alpine\n```\n\nIt is also possible to just build the image without testing with `make build_2.8.0`, just testing: `make test_2.8.0`, running the image: `make run_2.8.0` or even run the image for a shell `make runsh_2.8.0`.\n\nYou can also override the artemis binary distribution url by passing a parameter containing a zip file containing the distribution.  ie.  `make BUILD_ARGS=\"--build-arg ACTIVEMQ_DISTRIBUTION_URL=https://repository.apache.org/content/repositories/releases/org/apache/activemq/apache-artemis/2.6.4/apache-artemis-2.8.0-bin.zip\" 2.8.0`.   Note that you also need to pass in the version # as the first argument (ie 2.8.0)\n\n"
  },
  {
    "path": "LICENSE",
    "content": "\n                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"[]\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright [yyyy] [name of copyright owner]\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n\n"
  },
  {
    "path": "Makefile",
    "content": "\n.PHONY: help build test run all\n\nVERSIONS_FILE=tags.csv\n\nALL_VERSION_TAGS=$(shell awk -F \",\" 'NR>1  {print $$2}' ${VERSIONS_FILE})\nlookupFromTag=$(shell awk -F \",\" '$$2 == \"$1\" {print $$$2}' ${VERSIONS_FILE})\nlookupRepositoryFromTag=$(call lookupFromTag,$1, 1)\nlookupBaseImageFromTag=$(call lookupFromTag,$1, 3)\nlookupÀliasesFromTag=$(call lookupFromTag,$1, 4)\nlookupDockerfileFromTag=$(call lookupFromTag,$1, 5)\n\ngetPart=$(word $2,$(subst -, ,$1))\ngetVersionFromTag=$(call getPart,$1, 1)\ngetVariantFromTag=$(call getPart,$1, 2)\ngetFullTagNameFromTag=$(call lookupRepositoryFromTag,$1):$(call getVersionFromTag,$1)$(if $(call getVariantFromTag,$1),-$(call getVariantFromTag,$1),\"\")\n\n%: build_% test_% tag_%\n\t\n\nbuild_%:\n\t@cd src && \\\n\techo Building version $* && \\\n\tdocker build --quiet --build-arg ACTIVEMQ_ARTEMIS_VERSION=$(call getVersionFromTag,$*) --build-arg BASE_IMAGE=$(call lookupBaseImageFromTag,$*) $(BUILD_ARGS) -t $(call getFullTagNameFromTag,$*) -f $(call lookupDockerfileFromTag,$*) .\n\ntag_%:\n\t@for alias in $(call lookupÀliasesFromTag,$*); do docker tag $(call getFullTagNameFromTag,$*) $$alias ; done\n\npush_%:\n\t@docker push $(call getFullTagNameFromTag,$*)\n\t@for alias in $(call lookupÀliasesFromTag,$*); do docker push $$alias ; done\n\nrun_%: build\n\tdocker run -i -t --rm $(call getFullTagNameFromTag,$*)\n\nrunsh_%: build\n\tdocker run -i -t --rm $(call getFullTagNameFromTag,$*) /bin/sh\n\nall: $(ALL_VERSION_TAGS)\n\ntest_%:\n\t@DOCKER_FILE=$(call lookupDockerfileFromTag,$*) COORDINATES=$(call getFullTagNameFromTag,$*) ACTIVEMQ_ARTEMIS_VERSION=$(call getVersionFromTag,$*) TAG=$* bats test/*.bats\n\t@echo\n\n\t\n"
  },
  {
    "path": "README.md",
    "content": "![latest 2.16.0](https://img.shields.io/badge/latest-2.16.0-blue.svg?style=flat) ![License MIT](https://img.shields.io/badge/license-APACHE-blue.svg) [![Build Status](https://travis-ci.org/vromero/activemq-artemis-docker.svg?branch=master)](https://travis-ci.org/vromero/activemq-artemis-docker) [![](https://img.shields.io/docker/stars/vromero/activemq-artemis.svg)](https://hub.docker.com/r/vromero/activemq-artemis 'DockerHub') [![](https://img.shields.io/docker/pulls/vromero/activemq-artemis.svg)](https://hub.docker.com/r/vromero/activemq-artemis 'DockerHub') [![Say Thanks!](https://img.shields.io/badge/Say%20Thanks-!-1EAEDB.svg)](https://saythanks.io/to/vromero)\n\n## THIS PROJECT IS ARCHIVED \n\nIt has been quite a ride but after a few years, with multiple initiatives going on around Artemis and Docker both from Redhat and from Apache, I've decided that its time to let these project take the spot the community around this project and I have been occuping till now.\n\nOf course the project will remain read-only and you should feel free to fork but I won't be maintaining anymore.\n\n## 1. What is ActiveMQ Artemis?\n\n[Apache ActiveMQ Artemis](https://activemq.apache.org/artemis) is an open source project to build a multi-protocol, embeddable, very high performance, clustered, asynchronous messaging system. Apache ActiveMQ Artemis is an example of Message Oriented Middleware (MoM).\n\n![logo](https://activemq.apache.org/assets/img/activemq_logo_black_small.png)\n\n## 2. Tags and `Dockerfile` links\n\n| Debian Based                                                                                 | Alpine Based                                                                                               |\n|--------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |\n| [`latest`](https://raw.githubusercontent.com/vromero/activemq-artemis-docker/master/src/Dockerfile) | [`latest-alpine`](https://raw.githubusercontent.com/vromero/activemq-artemis-docker/master/src/Dockerfile.alpine) |\n| [`2.16.0`](https://raw.githubusercontent.com/vromero/activemq-artemis-docker/master/src/Dockerfile)  | [`2.16.0-alpine`](https://raw.githubusercontent.com/vromero/activemq-artemis-docker/master/src/Dockerfile.alpine)  |\n| [`2.15.0`](https://raw.githubusercontent.com/vromero/activemq-artemis-docker/master/src/Dockerfile)  | [`2.15.0-alpine`](https://raw.githubusercontent.com/vromero/activemq-artemis-docker/master/src/Dockerfile.alpine)  |\n| [`2.14.0`](https://raw.githubusercontent.com/vromero/activemq-artemis-docker/master/src/Dockerfile)  | [`2.14.0-alpine`](https://raw.githubusercontent.com/vromero/activemq-artemis-docker/master/src/Dockerfile.alpine)  |\n| [`2.13.0`](https://raw.githubusercontent.com/vromero/activemq-artemis-docker/master/src/Dockerfile)  | [`2.13.0-alpine`](https://raw.githubusercontent.com/vromero/activemq-artemis-docker/master/src/Dockerfile.alpine)  |\n| [`2.12.0`](https://raw.githubusercontent.com/vromero/activemq-artemis-docker/master/src/Dockerfile)  | [`2.12.0-alpine`](https://raw.githubusercontent.com/vromero/activemq-artemis-docker/master/src/Dockerfile.alpine)  |\n| [`2.11.0`](https://raw.githubusercontent.com/vromero/activemq-artemis-docker/master/src/Dockerfile)  | [`2.11.0-alpine`](https://raw.githubusercontent.com/vromero/activemq-artemis-docker/master/src/Dockerfile.alpine)  |\n| [`2.10.1`](https://raw.githubusercontent.com/vromero/activemq-artemis-docker/master/src/Dockerfile)  | [`2.10.1-alpine`](https://raw.githubusercontent.com/vromero/activemq-artemis-docker/master/src/Dockerfile.alpine)  |\n| [`2.10.0`](https://raw.githubusercontent.com/vromero/activemq-artemis-docker/master/src/Dockerfile)  | [`2.10.0-alpine`](https://raw.githubusercontent.com/vromero/activemq-artemis-docker/master/src/Dockerfile.alpine)  |\n| [`2.9.0`](https://raw.githubusercontent.com/vromero/activemq-artemis-docker/master/src/Dockerfile)  | [`2.9.0-alpine`](https://raw.githubusercontent.com/vromero/activemq-artemis-docker/master/src/Dockerfile.alpine)  |\n| [`2.8.0`](https://raw.githubusercontent.com/vromero/activemq-artemis-docker/master/src/Dockerfile)  | [`2.8.0-alpine`](https://raw.githubusercontent.com/vromero/activemq-artemis-docker/master/src/Dockerfile.alpine)  |\n| [`2.7.0`](https://raw.githubusercontent.com/vromero/activemq-artemis-docker/master/src/Dockerfile)  | [`2.7.0-alpine`](https://raw.githubusercontent.com/vromero/activemq-artemis-docker/master/src/Dockerfile.alpine)  |\n| [`2.6.4`](https://raw.githubusercontent.com/vromero/activemq-artemis-docker/master/src/Dockerfile)  | [`2.6.4-alpine`](https://raw.githubusercontent.com/vromero/activemq-artemis-docker/master/src/Dockerfile.alpine)  |\n| [`2.6.3`](https://raw.githubusercontent.com/vromero/activemq-artemis-docker/master/src/Dockerfile)  | [`2.6.3-alpine`](https://raw.githubusercontent.com/vromero/activemq-artemis-docker/master/src/Dockerfile.alpine)  |\n| [`2.6.2`](https://raw.githubusercontent.com/vromero/activemq-artemis-docker/master/src/Dockerfile)  | [`2.6.2-alpine`](https://raw.githubusercontent.com/vromero/activemq-artemis-docker/master/src/Dockerfile.alpine)  |\n| [`2.6.1`](https://raw.githubusercontent.com/vromero/activemq-artemis-docker/master/src/Dockerfile)  | [`2.6.1-alpine`](https://raw.githubusercontent.com/vromero/activemq-artemis-docker/master/src/Dockerfile.alpine)  |\n| [`2.6.0`](https://raw.githubusercontent.com/vromero/activemq-artemis-docker/master/src/Dockerfile)  | [`2.6.0-alpine`](https://raw.githubusercontent.com/vromero/activemq-artemis-docker/master/src/Dockerfile.alpine)  |\n| [`2.5.0`](https://raw.githubusercontent.com/vromero/activemq-artemis-docker/master/src/Dockerfile)  | [`2.5.0-alpine`](https://raw.githubusercontent.com/vromero/activemq-artemis-docker/master/src/Dockerfile.alpine)  |\n| [`2.4.0`](https://raw.githubusercontent.com/vromero/activemq-artemis-docker/master/src/Dockerfile)  | [`2.4.0-alpine`](https://raw.githubusercontent.com/vromero/activemq-artemis-docker/master/src/Dockerfile.alpine)  |\n| [`2.3.0`](https://raw.githubusercontent.com/vromero/activemq-artemis-docker/master/src/Dockerfile)  | [`2.3.0-alpine`](https://raw.githubusercontent.com/vromero/activemq-artemis-docker/master/src/Dockerfile.alpine)  |\n| [`2.2.0`](https://raw.githubusercontent.com/vromero/activemq-artemis-docker/master/src/Dockerfile)  | [`2.2.0-alpine`](https://raw.githubusercontent.com/vromero/activemq-artemis-docker/master/src/Dockerfile.alpine)  |\n| [`2.1.0`](https://raw.githubusercontent.com/vromero/activemq-artemis-docker/master/src/Dockerfile)  | [`2.1.0-alpine`](https://raw.githubusercontent.com/vromero/activemq-artemis-docker/master/src/Dockerfile.alpine)  |\n| [`2.0.0`](https://raw.githubusercontent.com/vromero/activemq-artemis-docker/master/src/Dockerfile)  | [`2.0.0-alpine`](https://raw.githubusercontent.com/vromero/activemq-artemis-docker/master/src/Dockerfile.alpine)  |\n| [`1.5.6`](https://raw.githubusercontent.com/vromero/activemq-artemis-docker/master/src/Dockerfile)  | [`1.5.6-alpine`](https://raw.githubusercontent.com/vromero/activemq-artemis-docker/master/src/Dockerfile.alpine)  |\n| ~~[`1.5.5`](https://raw.githubusercontent.com/vromero/activemq-artemis-docker/master/src/Dockerfile)~~  | ~~[`1.5.5-alpine`](https://raw.githubusercontent.com/vromero/activemq-artemis-docker/master/src/Dockerfile.alpine)~~  |\n| ~~[`1.5.4`](https://raw.githubusercontent.com/vromero/activemq-artemis-docker/master/src/Dockerfile)~~  | ~~[`1.5.4-alpine`](https://raw.githubusercontent.com/vromero/activemq-artemis-docker/master/src/Dockerfile.alpine)~~  |\n| ~~[`1.5.3`](https://raw.githubusercontent.com/vromero/activemq-artemis-docker/master/src/Dockerfile)~~  | ~~[`1.5.3-alpine`](https://raw.githubusercontent.com/vromero/activemq-artemis-docker/master/src/Dockerfile.alpine)~~  |\n| ~~[`1.5.2`](https://raw.githubusercontent.com/vromero/activemq-artemis-docker/master/src/Dockerfile)~~  | ~~[`1.5.2-alpine`](https://raw.githubusercontent.com/vromero/activemq-artemis-docker/master/src/Dockerfile.alpine)~~  |\n| ~~[`1.5.1`](https://raw.githubusercontent.com/vromero/activemq-artemis-docker/master/src/Dockerfile)~~  | ~~[`1.5.1-alpine`](https://raw.githubusercontent.com/vromero/activemq-artemis-docker/master/src/Dockerfile.alpine)~~  |\n| ~~[`1.5.0`](https://raw.githubusercontent.com/vromero/activemq-artemis-docker/master/src/Dockerfile)~~  | ~~[`1.5.0-alpine`](https://raw.githubusercontent.com/vromero/activemq-artemis-docker/master/src/Dockerfile.alpine)~~  |\n| ~~[`1.4.0`](https://raw.githubusercontent.com/vromero/activemq-artemis-docker/master/src/Dockerfile)~~  | ~~[`1.4.0-alpine`](https://raw.githubusercontent.com/vromero/activemq-artemis-docker/master/src/Dockerfile.alpine)~~  |\n| ~~[`1.3.0`](https://raw.githubusercontent.com/vromero/activemq-artemis-docker/master/src/Dockerfile)~~  | ~~[`1.3.0-alpine`](https://raw.githubusercontent.com/vromero/activemq-artemis-docker/master/src/Dockerfile.alpine)~~  |\n| ~~[`1.2.0`](https://raw.githubusercontent.com/vromero/activemq-artemis-docker/master/src/Dockerfile)~~  | ~~[`1.2.0-alpine`](https://raw.githubusercontent.com/vromero/activemq-artemis-docker/master/src/Dockerfile.alpine)~~  |\n| ~~[`1.1.0`](https://raw.githubusercontent.com/vromero/activemq-artemis-docker/master/src/Dockerfile)~~  | ~~[`1.1.0-alpine`](https://raw.githubusercontent.com/vromero/activemq-artemis-docker/master/src/Dockerfile.alpine)~~  |\n| ~~[`1.0.0`](https://raw.githubusercontent.com/vromero/activemq-artemis-docker/master/src/Dockerfile)~~  | ~~[`1.0.0-alpine`](https://raw.githubusercontent.com/vromero/activemq-artemis-docker/master/src/Dockerfile.alpine)~~  |\n\n## 3. About this image\n\nThe ActiveMQ Artemis images come in two flavors, both equally supported :\n\n- **Debian based**: the default one.\n- **Alpine based**: much lighter.\n\nAll versions of ActiveMQ Artemis are provided for the time being but versions previous to 1.5.5 shall be considered deprecated and could be removed at any time.\n\nThis image shall not be considered production ready as is. If you plan to use this image in a production environment, fork the image in order to maintain stability as\nthe build is [reproducible](https://reproducible-builds.org/) in a best effort basis. Then at each rebase, make sure you tests the changes you are importing.\n\n## 4. How to use this image\n\nYou can find how to run this image in the section *Running the image*. Beware as the default\nconfiguration is not recommended for production usage, at the very least you'll want to set your own\nlogin and password. This is described with detail in section *Setting the username and password*.\nIn case you also want to set some customized memory limits, this is described in\n*Setting the memory values*.\n\nActiveMQ Artemis typically persists the queue state to disk. In order to leverage the most of your\ndisk ActiveMQ artemis might require some fine-tuning. The good news is that this process is\nfully automated and its described in *Performing a performance journal test*.\n\nJMX uses RMI and therefore random ports. This is extremely bad for automatization in Docker and\nin general. For that reason its not supported for most of the use cases. However, when using this\nimage in orchestrators like Kubernetes you might want to connect from a sidecar where it\ndoes make sense. How to enable JMX is described in section *Enabling JMX*.\n\nThe Jolokia console CORS header won't be a problem by default as it set to `*`, however if you want to\nnarrow it down for improved security don't miss the section *Settings the console's allow origin*.\n\nIn rare ocassions you might find the need of running ActiveMQ Artemis without security. This\nis described in section *Disabling security*.\n\nSome of the configurations mentioned above are scripted automations that modify the\nconfiguration files. You might have your own configuration that you want to provide as a whole.\nIn that case disregard the aforementioned sections and find how to pass your own\nconfiguration in section *Using external configuration files*.\n\nIf instead you want to use the configuration parameters and make some non-mayor changes to the\nconfiguration you could use the mechanisms to apply some small transformations using XSLT\nas described in section *Overriding parts of the configuration*.\n\n## 5. Running the image\n\nThere are different methods to run a Docker image, from interactive Docker to Kubernetes and Docker\nCompose. This documentation will cover only Docker with an interactive terminal mode. You should\nrefer to the appropriate documentation for more information around other execution methods.\n\nTo run ActiveMQ with AMQP, JMS and the web console open (if your are running `2.3.0` or later),\nrun the following command:\n\n```console\ndocker run -it --rm \\\n  -p 8161:8161 \\\n  -p 61616:61616 \\\n  vromero/activemq-artemis\n```  \n\nAfter a few seconds you'll see in the output a block similar to:\n\n    _        _               _\n    / \\  ____| |_  ___ __  __(_) _____\n    / _ \\|  _ \\ __|/ _ \\  \\/  | |/  __/\n    / ___ \\ | \\/ |_/  __/ |\\/| | |\\___ \\\n    /_/   \\_\\|   \\__\\____|_|  |_|_|/___ /\n    Apache ActiveMQ Artemis x.x.x\n\n    HH:mm:ss,SSS INFO  [...] AMQ101000: Starting ActiveMQ Artemis Server\n\nAt this point you can open the web server port at [`8161`](http://127.0.0.1:8161) and check the web console using\nthe default username and password of `artemis` / `simetraehcapa`.\n\n### 5.1 Setting the username and password\n\nIf you wish to change the default username and password of `artemis` / `simetraehcapa`, you can do so with the `ARTEMIS_USERNAME` and `ARTEMIS_PASSWORD` environment variables:\n\n```console\ndocker run -it --rm \\\n  -e ARTEMIS_USERNAME=myuser \\\n  -e ARTEMIS_PASSWORD=otherpassword \\\n  vromero/activemq-artemis\n```\n\n### 5.2 Setting the memory values\n\nBy default this image does leverage the new features that came in Java 8u131 related to memory ergonomics in containerized environments, more information about it [here](https://developers.redhat.com/blog/2017/03/14/java-inside-docker/).\n\nIt does use a `-XX:MaxRAMFraction=2` meaning that half of the memory made avaiable to the container will be used by the Java heap, leaving the other half for other types of Java memory and other OS purposes. However, in some\ncircumstances it might be advisable to fine tune the memory to manual values, in that case you can set the memory that you application needs by using the parameters `ARTEMIS_MIN_MEMORY` and `ARTEMIS_MAX_MEMORY`:\n\n```console\ndocker run -it --rm \\\n  -e 'ARTEMIS_MIN_MEMORY=1512M' \\\n  -e 'ARTEMIS_MAX_MEMORY=3048M' \\\n  vromero/activemq-artemis\n```\n\nThe previous example will launch Apache ActiveMQ Artemis in docker with 1512 MB of memory, with a maximum usage of 3048 MB of memory.\nThe format of the values passed is the same than the format used for the Java `-Xms` and `-Xmx` parameters and its documented [here](http://docs.oracle.com/javase/7/docs/technotes/tools/solaris/java.html).\n\n### 5.3 Performing a performance journal test\n\nDifferent kinds of volumes need different values in fine tuning. In ActiveMQ Artemis the `journal-buffer-timeout` is oftentimes configured for this purpose.\n**Since `1.5.3`** it is possible to calculate the optimal value automatically. This image supports this automation using the environment variable: `ARTEMIS_PERF_JOURNAL` with one of the following values:\n\n| Value            | Description                                                       |\n|------------------|-------------------------------------------------------------------|\n|`AUTO` (default)  | Checks for the existence of a `.perf-journal-completed` file in the data volume, if it doesn't exist performs the calculation, applies the configuration and creates the file. |\n|`NEVER`           | Never do the performance journal configuration                    |\n|`ALWAYS`          | Always do the performance journal configuration                   |\n\nIt is safe to leave it as `AUTO` even for the casual usage of this image given that the image already have\nincorporated a `.perf-journal-completed` for its internal directory used when no volume is mounted.\nOne example of execution with the performance journal calibration set to be executed always can be found\nin the next listing:\n\n```console\ndocker run -it --rm \\\n  -e ARTEMIS_PERF_JOURNAL=ALWAYS \\\n  vromero/activemq-artemis\n```\n\n### 5.4 Critical Analysis\n\nSince 2.3.0 ActiveMQ Artemis can monitor *Queue delivery (add to the queue)*, *Journal storage* and *Paging operations* timings for anomalies in case there are IO errors or Memory issues (describe in detail [here](https://activemq.apache.org/components/artemis/documentation/latest/critical-analysis.html)).\n\nThe following properties can configure the critical analysis:\n\n| Value                            | Description                                                                       |\n|----------------------------------|-----------------------------------------------------------------------------------|\n|`CRITICAL_ANALYZER`               | Enable or disable the critical analysis (default true or false)                   |\n|`CRITICAL_ANALYZER_TIMEOUT`       | Timeout used to do the critical analysis (default 120000 milliseconds)            |\n|`CRITICAL_ANALYZER_CHECK_PERIOD`  | Time used to check the response times (default half of critical-analyzer-timeout) |\n|`CRITICAL_ANALYZER_POLICY`        | Should the server log, be halted or shutdown upon failures (default HALT or LOG)  |\n\n### 5.5 Enabling JMX\n\nDue to the JMX's nature, often with dynamics ports for RMI and the need having configure the public IP address to reach the RMI server.\nIt is discouraged to use JMX in Docker. Although in certain scenarios, it could be advisable, as when deploying in a\ncontainer orchestrator such as Kubernetes or Mesos, and deploying along side this container a side car. For such cases\nthe following environment variable could be used: `ENABLE_JMX`.\n\nIt is also possible to set the JMX port and the JMX RMI port with these two environment variables respectively: `JMX_PORT` (default: 1099) and `JMX_RMI_PORT` (default: 1098).\n\nGiven that JMX is intended for side cars, it is attached only to localhost and not protected with SSL. Likewise, its ports are not declared in the `Dockerfile`.\n\n```console\ndocker run -it --rm \\\n  -e ENABLE_JMX=true \\\n  -e JMX_PORT=1199 \\\n  -e JMX_RMI_PORT=1198 \\\n  vromero/activemq-artemis\n```\n\n### 5.6 Using JSON Output\n\nIt can be oftentimes preferrable to have the log output structured in a parseable format. \nThis image supports the usage of `org.jboss.logmanager.formatters.JsonFormatter` to format\nthe output. To enable it `LOG_FORMATTER=JSON` can be passed as environment variable.\n\n```console\ndocker run -it --rm \\\n  -e LOG_FORMATTER=JSON \\\n  vromero/activemq-artemis\n```\nWhen used, the output will look similar to the following listing:\n\n```console\n     _        _               _\n    / \\  ____| |_  ___ __  __(_) _____\n   / _ \\|  _ \\ __|/ _ \\  \\/  | |/  __/\n  / ___ \\ | \\/ |_/  __/ |\\/| | |\\___ \\\n /_/   \\_\\|   \\__\\____|_|  |_|_|/___ /\n Apache ActiveMQ Artemis 2.x.x\n\n{\"timestamp\":\"2020-04-25T09:43:17.222Z\",\"sequence\":0,\"loggerClassName\":\"org.apache.activemq.artemis.integration.bootstrap.ActiveMQBootstrapLogger_$logger\",\"loggerName\":\"org.apache.activemq.artemis.integration.bootstrap\",\"level\":\"INFO\",\"message\":\"AMQ101000: Starting ActiveMQ Artemis Server\",\"threadName\":\"main\",\"threadId\":1,\"mdc\":{},\"ndc\":\"\",\"hostName\":\"354e0e2e67cb\",\"processName\":\"Artemis\",\"processId\":78}\n{\"timestamp\":\"2020-04-25T09:43:17.408Z\",\"sequence\":1,\"loggerClassName\":\"org.apache.activemq.artemis.core.server.ActiveMQServerLogger_$logger\",\"loggerName\":\"org.apache.activemq.artemis.core.server\",\"level\":\"INFO\",\"message\":\"AMQ221000: live Message Broker is starting with configuration Broker Configuration (clustered=false,journalDirectory=data/journal,bindingsDirectory=data/bindings,largeMessagesDirectory=data/large-messages,pagingDirectory=data/paging)\",\"threadName\":\"main\",\"threadId\":1,\"mdc\":{},\"ndc\":\"\",\"hostName\":\"354e0e2e67cb\",\"processName\":\"Artemis\",\"processId\":78}\n{\"timestamp\":\"2020-04-25T09:43:17.648Z\",\"sequence\":2,\"loggerClassName\":\"org.apache.activemq.artemis.core.server.ActiveMQServerLogger_$logger\",\"loggerName\":\"org.apache.activemq.artemis.core.server\",\"level\":\"INFO\",\"message\":\"AMQ221012: Using AIO Journal\",\"threadName\":\"main\",\"threadId\":1,\"mdc\":{},\"ndc\":\"\",\"hostName\":\"354e0e2e67cb\",\"processName\":\"Artemis\",\"processId\":78}\n```\n\n### 5.7 Prometheus metrics\n\nWhen using this image in a orchestrated environmnet like in Kubernetes. It is often useful to have metrics endpoints compatible\nwith prometheus to ease monitoring.\n\nThis image can export such metrics in port `9404` thanks to the integration with the Prometheus [JMX exporter](https://github.com/prometheus/jmx_exporter). In order to enable it the environmnet variable `ENABLE_JMX_EXPORTER` should\nbe present, it will also inderectly enable JMX as if `ENABLE_JMX` was set.\n\nTo see what is exported just:\n\n```console\ndocker run -it --rm \\\n  -p9404:9404 \\\n  -e ENABLE_JMX_EXPORTER=true \\\n  vromero/activemq-artemis\n```\n\nAnd then in a different terminal run:\n\n```console\ncurl http://127.0.0.1:9404\n```\n\nTo obtain the following and more:\n\n```\n# HELP artemis_disk_scan_period How often to check for disk space usage, in milliseconds (org.apache.activemq.artemis<broker=\"0.0.0.0\"><>DiskScanPeriod)\n# TYPE artemis_disk_scan_period counter\nartemis_disk_scan_period 5000.0\n# HELP artemis_durable_delivering_count number of durable messages that this queue is currently delivering to its consumers (org.apache.activemq.artemis<broker=\"0.0.0.0\", component=addresses, address=\"DLQ\", subcomponent=queues, routing-type=\"anycast\", queue=\"DLQ\"><>DurableDeliveringCount)\n# TYPE artemis_durable_delivering_count counter\nartemis_durable_delivering_count{queue=\"DLQ\",address=\"DLQ\",} 0.0\nartemis_durable_delivering_count{queue=\"ExpiryQueue\",address=\"ExpiryQueue\",} 0.0\n# HELP artemis_journal_min_files Number of journal files to pre-create (org.apache.activemq.artemis<broker=\"0.0.0.0\"><>JournalMinFiles)\n# TYPE artemis_journal_min_files counter\nartemis_journal_min_files 2.0\n# HELP artemis_message_expiry_thread_priority Priority of the thread used to scan message expiration (org.apache.activemq.artemis<broker=\"0.0.0.0\"><>MessageExpiryThreadPriority)\n# TYPE artemis_message_expiry_thread_priority counter\nartemis_message_expiry_thread_priority 3.0\n# HELP artemis_messages_killed number of messages removed from this queue since it was created due to exceeding the max delivery attempts (org.apache.activemq.artemis<broker=\"0.0.0.0\", component=addresses, address=\"DLQ\", subcomponent=queues, routing-type=\"anycast\", queue=\"DLQ\"><>MessagesKilled)\n# TYPE artemis_messages_killed counter\nartemis_messages_killed{queue=\"DLQ\",address=\"DLQ\",} 0.0\nartemis_messages_killed{queue=\"ExpiryQueue\",address=\"ExpiryQueue\",} 0.0\n# HELP artemis_address_memory_usage_percentage Memory used by all the addresses on broker as a percentage of global maximum limit (org.apache.activemq.artemis<broker=\"0.0.0.0\"><>AddressMemoryUsagePercentage)\n# TYPE artemis_address_memory_usage_percentage counter\nartemis_address_memory_usage_percentage 0.0\n# HELP artemis_journal_sync_non_transactional Whether the journal is synchronized when receiving non-transactional datar (org.apache.activemq.artemis<broker=\"0.0.0.0\"><>JournalSyncNonTransactional)\n# TYPE artemis_journal_sync_non_transactional counter\nartemis_journal_sync_non_transactional 1.0\n# HELP artemis_journal_buffer_size Size of the internal buffer on the journal (org.apache.activemq.artemis<broker=\"0.0.0.0\"><>JournalBufferSize)\n# TYPE artemis_journal_buffer_size counter\nartemis_journal_buffer_size 501760.0\n# HELP artemis_journal_max_io Maximum number of write requests that can be in the AIO queue at any given time (org.apache.activemq.artemis<broker=\"0.0.0.0\"><>JournalMaxIO)\n# TYPE artemis_journal_max_io counter\nartemis_journal_max_io 4096.0\n```\n\nIn case you need more control over the metrics that are exported, you can mount a [jmx-exporter](https://github.com/prometheus/jmx_exporter)\nconfiguration file in `/opt/jmx-exporter/etc-override` with the file name `jmx-exporter-config.yaml`.\n\n### 5.8 Settings the console's allow origin\n\nActiveMQ Artemis console uses Jolokia. In the default vanilla non-docker installation Jolokia does set a CORS header to\nallow only localhost. In the docker image this create problems as things are rarely accesed as localhost.\n\nTherefore the docker image does set the CORS header to `*` by default. However there is a mechanism to narrow it\ndown to whatever value is best suited to you for improved security through the environmnet property: `JOLOKIA_ALLOW_ORIGIN`.\n\n```console\ndocker run -it --rm \\\n  -e JOLOKIA_ALLOW_ORIGIN=192.168.1.1 \\\n  vromero/activemq-artemis\n```\n\n### 5.9 Overriding parts of the configuration\n\nActiveMQ Artemis support disabling the security using the element `<security-enabled>false</security-enabled>`\nas described in the official [documentation](https://activemq.apache.org/artemis/docs/latest/security.html).\nThis docker image makes it simple to set that element using the environment property: `DISABLE_SECURITY`:\n\n```console\ndocker run -it --rm \\\n  -e DISABLE_SECURITY=true \\\n  vromero/activemq-artemis\n```\n\nPlease keep in mind no production system, possible no environment at all, should ever disable security.\nMake sure you read the falacy number one of the [falacies of the distributed computing](https://en.wikipedia.org/wiki/Fallacies_of_distributed_computing) before disabling the security.\n\n### 5.10 Using external configuration files\n\nIt is possible to mount a whole artemis `etc` directory in this image in the volume `/var/lib/artemis/etc`.\nBe careful as this might be an overkill for many situations where only small tweaks are necessary.  \n\nWhen using this technique be aware that the configuration files of Artemis might change from version to version.\nGenerally speaking, when in need to configure Artemis beyond what it is offered by this image using environment\nvariables, it is recommended to use the partial override mechanism described in the next section.\n\n### 5.11 Overriding parts of the configuration\n\nThe default ActiveMQ Artemis configuration can be partially modified, instead of completely replaced as in the previous section, using three mechanisms. Merge snippets, XSLT tranformations and entrypoint overrides.\n\n**Merging snippets**\n\nMultiple files with snippets of configuration can be dropped in the `/var/lib/artemis/etc-override` volume. Those configuration files must be named following the name convention `broker-{{num}}.xml` where `num` is a numeric representation of the snippet.\nThe configuration files will be *merged* with the default configuration. An alphabetical precedence of the file names will be considered for the merge and in case of collision the latest change will be treated as final.\n\nFor instance lets say that you want to add a diverts section, you could have a local directory, lets say `/var/artemis-data/etc-override`\nwhere you could place a `broker-00.xml` file that looks like the following listing:\n\n```xml\n<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n\n<configuration xmlns=\"urn:activemq\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:activemq /schema/artemis-configuration.xsd\">\n   <!-- from 1.0.0 to 1.5.5 the following line should be : <core xmlns=\"urn:activemq:core\"> -->\n   <core xmlns=\"urn:activemq:core\" xsi:schemaLocation=\"urn:activemq:core \">\n      <diverts>\n         <divert name=\"order-divert\">\n            <routing-name>order-divert</routing-name>\n            <address>orders</address>\n            <forwarding-address>spyTopic</forwarding-address>\n            <exclusive>false</exclusive>\n         </divert>\n      </diverts>\n   </core>\n</configuration>\n```\n\nPlease notice the `core` element change along with the versions:\n\n- `1.0.0` up to `1.5.5`: `<core xmlns=\"urn:activemq:core\">`\n- `2.0.0` onwards: `<core xmlns=\"urn:activemq:core\" xsi:schemaLocation=\"urn:activemq:core \">`\n\n**Configuration transformations**\n\nFor the use cases where instead of merging, the desired outcome is a deletion or some other kind of advanced transformation a file named `broker-00.xslt`\nin `/var/lib/artemis/etc-override` is supported. For instance to delete the `jms` definitions that is present by default in the `broker.xml` file shown below:\n\n```xml\n<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n\n<configuration xmlns=\"urn:activemq\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:activemq /schema/artemis-configuration.xsd\">\n  ...\n  <jms xmlns=\"urn:activemq:jms\">\n    <queue name=\"myfancyqueue\"/>\n    <queue name=\"myotherqueue\"/>\n  </jms>\n  ...\n</configuration>\n```\n\nA file name `broker-00.xslt` with content like the following listing, could be used:\n\n```xslt\n<xsl:stylesheet version=\"1.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\"\n  xmlns:activemq=\"urn:activemq\" xmlns:jms=\"urn:activemq:jms\">\n\n <xsl:output omit-xml-declaration=\"yes\"/>\n\n    <xsl:template match=\"node()|@*\">\n      <xsl:copy>\n         <xsl:apply-templates select=\"node()|@*\"/>\n      </xsl:copy>\n    </xsl:template>\n\n    <xsl:template match=\"*[local-name()='jms']\"/>\n</xsl:stylesheet>\n```\n\n**Entrypoint Overrides**\n\nMultiple shell scripts can be dropped in the `/var/lib/artemis/etc-override` volume. Those shell files must be named following the name convention `entrypoint-{{num}}.sh` where `num` is a numeric representation of the snippet.\nThe shell scripts will be *executed* in alphabetical precedence of the file names on startup of the docker container.   \n\nA typical use case for using entrypoint overrides would be if you want to make a minor modification to a file which cannot be overriden using the 2 methods above and you do not want to expose the etc volume.\n\n\nIf you would like to see the final result of your transformations, execute the following:\n\n```\ndocker run -it --rm \\\n  -v /var/artemis-data/override:/var/lib/artemis/etc-override \\\n  vromero/activemq-artemis \\\n  cat ../etc/broker.xml\n```\n\n### 5.12 Broker Config\n\nActiveMQ allows you to override key configuration values using [System properties](https://activemq.apache.org/artemis/docs/latest/configuration-index.html#System-properties).\nThis docker image has built in support to set these values by passing environment variables prefixed with BROKER_CONFIG to the docker image.  \n\nBelow is an example which overrides the global-max-size and disk-scan-period values\n```\ndocker run -it --rm   -p 8161:8161 \\\n    -e BROKER_CONFIG_GLOBAL_MAX_SIZE=50000 \\\n    -e BROKER_CONFIG_DISK_SCAN_PERIOD=6000 \\\n    vromero/activemq-artemis\n```\n\n### 5.13 Environment Variables\n\nAdditionally, the following environment variables are supported\n\n| Env Var         | Default          | Description                                                       |\n|---------------- |----------------- |-------------------------------------------------------------------|\n|JAVA_OPTS        |                  |Will pass additional java options to the artemis runtime           |\n\n### 5.14 Mount points\n\n| Mount point                      | Description                                                              |\n|--------------------------------- |--------------------------------------------------------------------------|\n|`/var/lib/artemis/data`           | Holds the data files used for storing persistent messages                |\n|`/var/lib/artemis/etc`            | Holds the instance configuration files                                   |\n|`/var/lib/artemis/etc-override`   | Holds the instance configuration files                                   |\n|`/var/lib/artemis/lock`           | Holds the command line locks (typically not useful to mount)             |\n|`/opt/jmx-exporter/etc-override`  | Holds the configuration file for jmx-exporter `jmx-exporter-config.yaml` |\n\n### 5.15 Exposed ports\n\n| Port    | Description                                                     |\n|-------- |-----------------------------------------------------------------|\n| `8161`  | Web Server                                                      |\n| `9404`  | JMX Exporter                                                    |\n| `61616` | Core,MQTT,AMQP,HORNETQ,STOMP,Openwire                           |\n| `5445`  | HORNETQ,STOMP                                                   |\n| `5672`  | AMQP                                                            |\n| `1883`  | MQTT                                                            |\n| `61613` | STOMP                                                           |\n\n## 6. Running in orchestrators\n\nAt the moment only docker is directly supported for this image. However there is an attempt to create\na helm chart for Kubernetes and some configuration tuning for OpenShift.\n\n### 6.1 Running in Kubernetes\n\nActiveMQ Artemis can leverage [JGroups](http://www.jgroups.org/) to discover the members of the cluster. And JGroups\ncan be extended with a plugin called [jgroups-kubernetes](https://github.com/jgroups-extras/jgroups-kubernetes/tree/0.9.3)\nthat allows JGroups to discover using Kubernetes. Both KUBE_PING (via Kubernetes API) and DNS_PING (using the SRV records of a\n[Kubernetes service](https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#srv-records)) building blocks are\nincluded to facilitate initial membership discovery.\n\n[jgroups-kubernetes](https://github.com/jgroups-extras/jgroups-kubernetes/tree/0.9.3) version `0.9.3` is included in the\nclasspath of this image, however everything about the configuration of jgroups and jgroups-kubernetes is left to the user.\n\nIf you rather prefer a easier solution to run a cluster of ActiveMQ Artemis nodes, there is an attempt to create a Helm chart\nby the same author of this image. It can be found [here](https://github.com/vromero/activemq-artemis-helm). It\ndoes leverage `jgroups-kubernetes` in a transparent way.\n\n### 6.2 OpenShift\n\nOpenShift has diverted a bit from Kubernetes (e.g: automounts empty volumes in all declared volumes without\nthe user asking for it at all) and Docker (e.g: runs on an random user).\n\nThe biggest problem to run this image is the automount of empty directories because it empties the `etc` directory.\nIn order to restore it the environment variable `RESTORE_CONFIGURATION` has been created. It can be used as follows:\n\n```bash\noc new-app --name=artemis vromero/activemq-artemis -e RESTORE_CONFIGURATION=true\n```\n\n## 7. License\n\nView [license information](http://www.apache.org/licenses/LICENSE-2.0) for the software contained in this image.\n\n## 8. User Feedback\n\n### 8.1 Issues\n\nIf you have any problems with or questions about this image, please contact us through a [GitHub issue](https://github.com/vromero/activemq-artemis-docker/issues).\n\n### 8.2 Contributing\n\nYou are invited to contribute new features, fixes, or updates, large or small; we are always thrilled to receive pull requests, and do our best to process them as fast as we can.\n\nBefore you start to code, we recommend discussing your plans through a [GitHub issue](https://github.com/vromero/activemq-artemis-docker/issues), especially for more ambitious contributions. This gives other contributors a chance to point you in the right direction, give you feedback on your design, and help you find out if someone else is working on the same thing.\n"
  },
  {
    "path": "src/Dockerfile",
    "content": "# ActiveMQ Artemis\n\n##########################################################\n## Build Image                                           #\n##########################################################\nARG BASE_IMAGE\nFROM openjdk:8u171-jdk-stretch as builder\nLABEL maintainer=\"Victor Romero <victor.romero@gmail.com>\"\n\nARG ACTIVEMQ_ARTEMIS_VERSION\nARG ACTIVEMQ_DISTRIBUTION_URL\nENV JMX_EXPORTER_VERSION=0.3.1\nENV JGROUPS_KUBERNETES_VERSION=0.9.3\nENV JAVAX_JSON_VERSION=1.1.4\n\n# See https://github.com/hadolint/hadolint/wiki/DL4006\nSHELL [\"/bin/bash\", \"-o\", \"pipefail\", \"-c\"]\n\nRUN apt-get -qq -o=Dpkg::Use-Pty=0 update && \\\n  apt-get -qq -o=Dpkg::Use-Pty=0 install -y --no-install-recommends \\\n    libaio1=0.3.110-3 \\\n    xmlstarlet=1.6.1-2 \\\n    jq=1.5+dfsg-1.3 \\\n    ca-certificates=20161130+nmu1+deb9u1 \\\n    wget=1.18-5+deb9u2 \\\n    ivy=2.4.0-3 && \\\n  rm -rf /var/lib/apt/lists/*\n\n# Make sure pipes are considered to detemine success, see: https://github.com/hadolint/hadolint/wiki/DL4006\nSHELL [\"/bin/bash\", \"-o\", \"pipefail\", \"-c\"]\n\n# Uncompress and validate\nWORKDIR /opt\nRUN if (echo \"${ACTIVEMQ_DISTRIBUTION_URL}\" | grep -Eq  \".zip\\$\" ) ; \\\n    then \\\n      mkdir tmp && \\\n      wget \"${ACTIVEMQ_DISTRIBUTION_URL}\" -P tmp/ && \\\n      unzip -d tmp -q \"tmp/*.zip\" && rm -f tmp/*.zip && ls -l tmp/ && \\\n        mv tmp/* ./apache-artemis-${ACTIVEMQ_ARTEMIS_VERSION} && \\\n        ln -s \"/opt/apache-artemis-${ACTIVEMQ_ARTEMIS_VERSION}\" \"/opt/apache-artemis\" && \\\n        rmdir tmp; \\\n    elif test -n \"${ACTIVEMQ_DISTRIBUTION_URL}\" ; \\\n    then \\\n      echo \"Only .zip format is supported when using ACTIVEMQ_DISTRIBUTION_URL\" && \\\n      exit 2; \\\n    else \\\n      wget \"https://repository.apache.org/content/repositories/releases/org/apache/activemq/apache-artemis/${ACTIVEMQ_ARTEMIS_VERSION}/apache-artemis-${ACTIVEMQ_ARTEMIS_VERSION}-bin.tar.gz\" && \\\n      wget \"https://repository.apache.org/content/repositories/releases/org/apache/activemq/apache-artemis/${ACTIVEMQ_ARTEMIS_VERSION}/apache-artemis-${ACTIVEMQ_ARTEMIS_VERSION}-bin.tar.gz.asc\" && \\\n      wget \"http://apache.org/dist/activemq/KEYS\" && \\\n      gpg --no-tty --import \"KEYS\" && \\\n      gpg --no-tty \"apache-artemis-${ACTIVEMQ_ARTEMIS_VERSION}-bin.tar.gz.asc\" && \\\n      tar xfz \"apache-artemis-${ACTIVEMQ_ARTEMIS_VERSION}-bin.tar.gz\" && \\\n      ln -s \"/opt/apache-artemis-${ACTIVEMQ_ARTEMIS_VERSION}\" \"/opt/apache-artemis\" && \\\n      rm -f \"apache-artemis-${ACTIVEMQ_ARTEMIS_VERSION}-bin.tar.gz\" \"KEYS\" \"apache-artemis-${ACTIVEMQ_ARTEMIS_VERSION}-bin.tar.gz.asc\"; \\\n    fi\n\n# Create broker instance\n# Per recommendation of https://activemq.apache.org/artemis/docs/latest/perf-tuning.html : -XX:+AggressiveOpts -XX:+UseFastAccessorMethods -XX:+UseParallelOldGC \nWORKDIR /var/lib\nRUN if test \"${ACTIVEMQ_ARTEMIS_VERSION}\" = \"1.0.0\" ; \\\n    then \\\n      echo n | \"/opt/apache-artemis-${ACTIVEMQ_ARTEMIS_VERSION}/bin/artemis\" create artemis \\\n        --home /opt/apache-artemis \\\n        --user artemis \\\n        --password simetraehcapa \\\n        --cluster-user artemisCluster \\\n        --cluster-password simetraehcaparetsulc ; \\\n    else \\\n      \"/opt/apache-artemis-${ACTIVEMQ_ARTEMIS_VERSION}/bin/artemis\" create artemis \\\n        --home /opt/apache-artemis \\\n        --user artemis \\\n        --password simetraehcapa \\\n        --role amq \\\n        --require-login \\\n        --cluster-user artemisCluster \\\n        --cluster-password simetraehcaparetsulc ; \\\n    fi \n\n# Using KUBE_PING 0.9.3. Can't upgrade to 1.x.x as Artemis uses JGroups 3.3.x \n# https://github.com/jgroups-extras/jgroups-kubernetes/issues/30\nWORKDIR /opt/jgroupskubernetes\nRUN java -jar /usr/share/java/ivy.jar -dependency org.jgroups.kubernetes kubernetes \"${JGROUPS_KUBERNETES_VERSION}\" -retrieve \"[artifact]-[revision](-[classifier]).[ext]\" -types jar && \\\n  java -jar /usr/share/java/ivy.jar -dependency org.jgroups.kubernetes dns \"${JGROUPS_KUBERNETES_VERSION}\" -retrieve \"[artifact]-[revision](-[classifier]).[ext]\" -types jar\n\n# JsonFormatter to enable JSON logging #148\nWORKDIR /opt/jsonformatter\nRUN java -jar /usr/share/java/ivy.jar -dependency org.glassfish javax.json \"${JAVAX_JSON_VERSION}\" -retrieve \"[artifact]-[revision](-[classifier]).[ext]\" -types bundle\n\nWORKDIR /var/lib/artemis/etc\n\n# Log to tty to enable docker logs container-name\nRUN sed -i \"s/logger.handlers=.*/logger.handlers=CONSOLE/g\" logging.properties\n\n# Add JSON log handler\nRUN echo \"formatter.JSON=org.jboss.logmanager.formatters.JsonFormatter\" | tee -a  logging.properties\nRUN sed -i \"s/-Xbootclasspath\\/a:\\\"\\(.*\\)\\\"/-Xbootclasspath\\/a:\\\"\\1:\\/opt\\/apache-artemis\\/lib\\/javax.json-1.1.4.jar\\\"/g\" /var/lib/artemis/bin/artemis\n\n# --java-options doesn't seem to work across the board on all versions adding them manually\nRUN sed -i \"s/JAVA_ARGS=\\\"/JAVA_ARGS=\\\"-Djava.net.preferIPv4Addresses=true -Djava.net.preferIPv4Stack=true -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -XX:MaxRAMFraction=2 /g\" ../etc/artemis.profile\n\n# Ports are only exposed with an explicit argument, there is no need to binding\n# the web console to localhost\nRUN xmlstarlet ed -L -N amq=\"http://activemq.org/schema\" \\\n    -u \"/amq:broker/amq:web/@bind\" \\\n    -v \"http://0.0.0.0:8161\" bootstrap.xml\n\n# In a similar fashion the jolokia access is restricted to localhost only. Disabling\n# this as in the natural environmnets for the image like Kubernetes this is problematic.\nRUN if (echo \"${ACTIVEMQ_ARTEMIS_VERSION}\" | grep -Eq  \"(2.[^0-3]\\\\.[0-9]|[^1-2]\\\\.[0-9]\\\\.[0-9]+)\" ) ; then xmlstarlet ed --inplace --subnode \"/restrict\" --type elem -n \"remote\" jolokia-access.xml && xmlstarlet ed --inplace --subnode \"/restrict/remote\" --type elem -n host -v \"0.0.0.0/0\" jolokia-access.xml; fi\n\n# Remove default values for memory in artemis profile in order to let the automatic\n# Java ergonomics detection work https://docs.oracle.com/javase/8/docs/technotes/guides/vm/gctuning/ergonomics.html\nRUN sed -i \"s/-Xm[xs][^ \\\"]*//g\" ../etc/artemis.profile\n\n# For the casual run of the image make the docker-entrypoint-sh think \n# that the performance journal calibration is already completed\nRUN if (echo \"${ACTIVEMQ_ARTEMIS_VERSION}\" | grep -Eq  \"(1.5\\\\.[3-5]|[^1]\\\\.[0-9]\\\\.[0-9]+)\" ) ; then touch /var/lib/artemis/data/.perf-journal-completed; fi\n\nWORKDIR /opt/jmx-exporter\nRUN wget \"https://repo1.maven.org/maven2/io/prometheus/jmx/jmx_prometheus_javaagent/${JMX_EXPORTER_VERSION}/jmx_prometheus_javaagent-${JMX_EXPORTER_VERSION}.jar\" && \\\n  wget \"https://repo1.maven.org/maven2/io/prometheus/jmx/jmx_prometheus_javaagent/${JMX_EXPORTER_VERSION}/jmx_prometheus_javaagent-${JMX_EXPORTER_VERSION}.jar.sha1\" && \\\n  echo \"$(cat \"jmx_prometheus_javaagent-${JMX_EXPORTER_VERSION}.jar.sha1\")\" \"jmx_prometheus_javaagent-${JMX_EXPORTER_VERSION}.jar\" | sha1sum -c - && \\\n  rm \"jmx_prometheus_javaagent-${JMX_EXPORTER_VERSION}.jar.sha1\" && \\\n  ln -s \"/opt/jmx-exporter/jmx_prometheus_javaagent-${JMX_EXPORTER_VERSION}.jar\" \"/opt/jmx-exporter/jmx_prometheus_javaagent.jar\"\n\nCOPY assets/jmx-exporter-config.yaml /opt/jmx-exporter/etc/\n\n##########################################################\n## Run Image                                             #\n##########################################################\nARG BASE_IMAGE\n# hadolint ignore=DL3006\nFROM $BASE_IMAGE\nLABEL maintainer=\"Victor Romero <victor.romero@gmail.com>\"\nARG ACTIVEMQ_ARTEMIS_VERSION\nENV ACTIVEMQ_ARTEMIS_VERSION=$ACTIVEMQ_ARTEMIS_VERSION\n\n# add user and group for artemis\nRUN groupadd -g 1000 -r artemis && useradd -r -u 1000 -g artemis artemis\n\nRUN apt-get -qq -o=Dpkg::Use-Pty=0 update && \\\n  apt-get -qq -o=Dpkg::Use-Pty=0 install -y --no-install-recommends \\\n    libaio1=0.3.110-3 \\\n    xmlstarlet=1.6.1-2 \\\n    jq=1.5+dfsg-1.3 \\\n    gettext-base=0.19.8.1-2+deb9u1 \\\n    dumb-init=1.2.0-1 \\\n    procps=2:3.3.12-3+deb9u1 && \\\n  rm -rf /var/lib/apt/lists/*\n\nCOPY --from=builder \"/opt/apache-artemis-${ACTIVEMQ_ARTEMIS_VERSION}\" \"/opt/apache-artemis-${ACTIVEMQ_ARTEMIS_VERSION}\"\nCOPY --from=builder \"/var/lib/artemis\" \"/var/lib/artemis\"\nCOPY --from=builder \"/opt/jmx-exporter\" \"/opt/jmx-exporter\"\nCOPY --from=builder \"/opt/jgroupskubernetes/*\" \"/opt/apache-artemis-${ACTIVEMQ_ARTEMIS_VERSION}/lib/\"\nCOPY --from=builder \"/opt/jsonformatter/*\" \"/opt/apache-artemis-${ACTIVEMQ_ARTEMIS_VERSION}/lib/\"\n\n# To enable RESTORE_CONFIGURATION\nCOPY --from=builder \"/var/lib/artemis/etc\" \"/var/lib/artemis/etc-backup\"\n\nRUN ln -s \"/opt/apache-artemis-${ACTIVEMQ_ARTEMIS_VERSION}\" /opt/apache-artemis && chmod 755 /opt/apache-artemis\nRUN chown -R artemis.artemis /var/lib/artemis\nRUN chown -R artemis.artemis /opt/jmx-exporter\n\nRUN mkdir -p /opt/assets\nCOPY assets/merge.xslt /opt/assets\nCOPY assets/enable-jmx.xml /opt/assets\nCOPY assets/semver2.sh /usr/local/bin/semver\n\n# Web Server\nEXPOSE 8161\n\n# JMX Exporter\nEXPOSE 9404\n\n# Port for CORE,MQTT,AMQP,HORNETQ,STOMP,OPENWIRE\nEXPOSE 61616\n\n# Port for HORNETQ,STOMP\nEXPOSE 5445\n\n# Port for AMQP\nEXPOSE 5672\n\n# Port for MQTT\nEXPOSE 1883\n\n#Port for STOMP\nEXPOSE 61613\n\nWORKDIR /var/lib/artemis/bin\n\nUSER artemis\n\nRUN mkdir /var/lib/artemis/lock\n\n# Expose some outstanding folders\nVOLUME [\"/var/lib/artemis/data\"]\nVOLUME [\"/var/lib/artemis/tmp\"]\nVOLUME [\"/var/lib/artemis/etc\"]\nVOLUME [\"/var/lib/artemis/etc-override\"]\nVOLUME [\"/var/lib/artemis/lock\"]\nVOLUME [\"/opt/jmx-exporter/etc-override\"]\n\nCOPY assets/docker-entrypoint.sh /\nENTRYPOINT [\"/docker-entrypoint.sh\"]\nCMD [\"artemis-server\"]\n"
  },
  {
    "path": "src/Dockerfile.alpine",
    "content": "# ActiveMQ Artemis\n\n##########################################################\n## Build Image                                           #\n##########################################################\nARG BASE_IMAGE\nFROM openjdk:8u171-jdk-stretch as builder\nLABEL maintainer=\"Victor Romero <victor.romero@gmail.com>\"\n\nARG ACTIVEMQ_ARTEMIS_VERSION\nARG ACTIVEMQ_DISTRIBUTION_URL\nENV JMX_EXPORTER_VERSION=0.3.1\nENV JGROUPS_KUBERNETES_VERSION=0.9.3\nENV JAVAX_JSON_VERSION=1.1.4\n\n# add user and group for artemis\nRUN groupadd -r artemis && useradd -r -s /bin/false -g artemis artemis\n\nRUN apt-get -qq -o=Dpkg::Use-Pty=0 update && \\\n  apt-get -qq -o=Dpkg::Use-Pty=0 install -y --no-install-recommends \\\n    libaio1=0.3.110-3 \\\n    xmlstarlet=1.6.1-2 \\\n    jq=1.5+dfsg-1.3 \\\n    ca-certificates=20161130+nmu1+deb9u1 \\\n    wget=1.18-5+deb9u2 \\\n    ivy=2.4.0-3 && \\\n  rm -rf /var/lib/apt/lists/*\n\n# Make sure pipes are considered to detemine success, see: https://github.com/hadolint/hadolint/wiki/DL4006\nSHELL [\"/bin/bash\", \"-o\", \"pipefail\", \"-c\"]\n\n# Uncompress and validate\nWORKDIR /opt\nRUN if (echo \"${ACTIVEMQ_DISTRIBUTION_URL}\" | grep -Eq  \".zip\\$\" ) ; \\\n    then \\\n      mkdir tmp && \\\n      wget \"${ACTIVEMQ_DISTRIBUTION_URL}\" -P tmp/ && \\\n      unzip -d tmp -q \"tmp/*.zip\" && rm -f tmp/*.zip && ls -l tmp/ && \\\n        mv tmp/* ./apache-artemis-${ACTIVEMQ_ARTEMIS_VERSION} && \\\n        ln -s \"/opt/apache-artemis-${ACTIVEMQ_ARTEMIS_VERSION}\" \"/opt/apache-artemis\" && \\\n        rmdir tmp; \\\n    elif test -n \"${ACTIVEMQ_DISTRIBUTION_URL}\" ; \\\n    then \\\n      echo \"Only .zip format is supported when using ACTIVEMQ_DISTRIBUTION_URL\" && \\\n      exit 2; \\\n    else \\\n      wget \"https://repository.apache.org/content/repositories/releases/org/apache/activemq/apache-artemis/${ACTIVEMQ_ARTEMIS_VERSION}/apache-artemis-${ACTIVEMQ_ARTEMIS_VERSION}-bin.tar.gz\" && \\\n      wget \"https://repository.apache.org/content/repositories/releases/org/apache/activemq/apache-artemis/${ACTIVEMQ_ARTEMIS_VERSION}/apache-artemis-${ACTIVEMQ_ARTEMIS_VERSION}-bin.tar.gz.asc\" && \\\n      wget \"http://apache.org/dist/activemq/KEYS\" && \\\n      gpg --no-tty --import \"KEYS\" && \\\n      gpg --no-tty \"apache-artemis-${ACTIVEMQ_ARTEMIS_VERSION}-bin.tar.gz.asc\" && \\\n      tar xfz \"apache-artemis-${ACTIVEMQ_ARTEMIS_VERSION}-bin.tar.gz\" && \\\n      ln -s \"/opt/apache-artemis-${ACTIVEMQ_ARTEMIS_VERSION}\" \"/opt/apache-artemis\" && \\\n      rm -f \"apache-artemis-${ACTIVEMQ_ARTEMIS_VERSION}-bin.tar.gz\" \"KEYS\" \"apache-artemis-${ACTIVEMQ_ARTEMIS_VERSION}-bin.tar.gz.asc\"; \\\n    fi\n\n# Create broker instance\n# Per recommendation of https://activemq.apache.org/artemis/docs/latest/perf-tuning.html : -XX:+AggressiveOpts -XX:+UseFastAccessorMethods -XX:+UseParallelOldGC \nWORKDIR /var/lib\nRUN if test \"${ACTIVEMQ_ARTEMIS_VERSION}\" = \"1.0.0\" ; \\\n    then \\\n      echo n | \"/opt/apache-artemis-${ACTIVEMQ_ARTEMIS_VERSION}/bin/artemis\" create artemis \\\n        --home /opt/apache-artemis \\\n        --user artemis \\\n        --password simetraehcapa \\\n        --cluster-user artemisCluster \\\n        --cluster-password simetraehcaparetsulc ; \\\n    else \\\n      \"/opt/apache-artemis-${ACTIVEMQ_ARTEMIS_VERSION}/bin/artemis\" create artemis \\\n        --home /opt/apache-artemis \\\n        --user artemis \\\n        --password simetraehcapa \\\n        --role amq \\\n        --require-login \\\n        --cluster-user artemisCluster \\\n        --cluster-password simetraehcaparetsulc ; \\\n    fi \n\n# Using KUBE_PING 0.9.3. Can't upgrade to 1.x.x as Artemis uses JGroups 3.3.x \n# https://github.com/jgroups-extras/jgroups-kubernetes/issues/30\nWORKDIR /opt/jgroupskubernetes\nRUN java -jar /usr/share/java/ivy.jar -dependency org.jgroups.kubernetes kubernetes \"${JGROUPS_KUBERNETES_VERSION}\" -retrieve \"[artifact]-[revision](-[classifier]).[ext]\" -types jar && \\\n    java -jar /usr/share/java/ivy.jar -dependency org.jgroups.kubernetes dns \"${JGROUPS_KUBERNETES_VERSION}\" -retrieve \"[artifact]-[revision](-[classifier]).[ext]\" -types jar\n\n# JsonFormatter to enable JSON logging #148\nWORKDIR /opt/jsonformatter\nRUN java -jar /usr/share/java/ivy.jar -dependency org.glassfish javax.json \"${JAVAX_JSON_VERSION}\" -retrieve \"[artifact]-[revision](-[classifier]).[ext]\" -types bundle\n\n# JsonFormatter to enable JSON logging #148\nWORKDIR /opt/jsonformatter\nRUN java -jar /usr/share/java/ivy.jar -dependency org.glassfish javax.json \"${JAVAX_JSON_VERSION}\" -retrieve \"[artifact]-[revision](-[classifier]).[ext]\" -types bundle\n\nWORKDIR /var/lib/artemis/etc\n\n# Log to tty to enable docker logs container-name\nRUN sed -i \"s/logger.handlers=.*/logger.handlers=CONSOLE/g\" logging.properties\n\n# Add JSON log handler\nRUN echo \"formatter.JSON=org.jboss.logmanager.formatters.JsonFormatter\" | tee -a  logging.properties\nRUN sed -i \"s/-Xbootclasspath\\/a:\\\"\\(.*\\)\\\"/-Xbootclasspath\\/a:\\\"\\1:\\/opt\\/apache-artemis\\/lib\\/javax.json-1.1.4.jar\\\"/g\" /var/lib/artemis/bin/artemis\n\n# --java-options doesn't seem to work across the board on all versions adding them manually\nRUN sed -i \"s/JAVA_ARGS=\\\"/JAVA_ARGS=\\\"-Djava.net.preferIPv4Addresses=true -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -XX:MaxRAMFraction=2 /g\" ../etc/artemis.profile\n\n# Ports are only exposed with an explicit argument, there is no need to binding\n# the web console to localhost\nRUN xmlstarlet ed -L -N amq=\"http://activemq.org/schema\" \\\n    -u \"/amq:broker/amq:web/@bind\" \\\n    -v \"http://0.0.0.0:8161\" bootstrap.xml\n\n# In a similar fashion the jolokia access is restricted to localhost only. Disabling\n# this as in the natural environmnets for the image like Kubernetes this is problematic.\nRUN if (echo \"${ACTIVEMQ_ARTEMIS_VERSION}\" | grep -Eq  \"(2.[^0-3]\\\\.[0-9]|[^1-2]\\\\.[0-9]\\\\.[0-9]+)\" ) ; then xmlstarlet ed --inplace --subnode \"/restrict\" --type elem -n \"remote\" jolokia-access.xml && xmlstarlet ed --inplace --subnode \"/restrict/remote\" --type elem -n host -v \"0.0.0.0/0\" jolokia-access.xml; fi\n\n# Remove default values for memory in artemis profile in order to let the automatic\n# Java ergonomics detection work https://docs.oracle.com/javase/8/docs/technotes/guides/vm/gctuning/ergonomics.html\nRUN sed -i \"s/-Xm[xs][^ \\\"]*//g\" ../etc/artemis.profile\n\n# For the casual run of the image make the docker-entrypoint-sh think \n# that the performance journal calibration is already completed\nRUN if (echo \"${ACTIVEMQ_ARTEMIS_VERSION}\" | grep -Eq  \"(1.5\\\\.[3-5]|[^1]\\\\.[0-9]\\\\.[0-9]+)\" ) ; then touch /var/lib/artemis/data/.perf-journal-completed; fi\n\nWORKDIR /opt/jmx-exporter\nRUN wget \"https://repo1.maven.org/maven2/io/prometheus/jmx/jmx_prometheus_javaagent/${JMX_EXPORTER_VERSION}/jmx_prometheus_javaagent-${JMX_EXPORTER_VERSION}.jar\" && \\\n  wget \"https://repo1.maven.org/maven2/io/prometheus/jmx/jmx_prometheus_javaagent/${JMX_EXPORTER_VERSION}/jmx_prometheus_javaagent-${JMX_EXPORTER_VERSION}.jar.sha1\" && \\\n  echo \"$(cat \"jmx_prometheus_javaagent-${JMX_EXPORTER_VERSION}.jar.sha1\")\" \"jmx_prometheus_javaagent-${JMX_EXPORTER_VERSION}.jar\" | sha1sum -c - && \\\n  rm \"jmx_prometheus_javaagent-${JMX_EXPORTER_VERSION}.jar.sha1\" && \\\n  ln -s \"/opt/jmx-exporter/jmx_prometheus_javaagent-${JMX_EXPORTER_VERSION}.jar\" \"/opt/jmx-exporter/jmx_prometheus_javaagent.jar\"\nCOPY assets/jmx-exporter-config.yaml /opt/jmx-exporter/etc/\n\n##########################################################\n## Run Image                                             #\n##########################################################\nARG BASE_IMAGE\n# hadolint ignore=DL3006\nFROM $BASE_IMAGE\nLABEL maintainer=\"Victor Romero <victor.romero@gmail.com>\"\nARG ACTIVEMQ_ARTEMIS_VERSION\nENV ACTIVEMQ_ARTEMIS_VERSION=$ACTIVEMQ_ARTEMIS_VERSION\n\n# add user and group for artemis\nRUN addgroup -g 1000 -S artemis && adduser -u 1000 -S -G artemis artemis\n\n# Sadly this line is likely to fail every so often, see: https://medium.com/@stschindler/the-problem-with-docker-and-alpines-package-pinning-18346593e891\n# Still versions are pinned to maintain some small level of https://reproducible-builds.org/\nRUN apk add --no-cache \\\n  libaio=0.3.111-r0 \\\n  xmlstarlet=1.6.1-r0 \\\n  jq=1.6-r0 \\\n  dumb-init=1.2.2-r1 \\\n  sed=4.5-r0 \\\n  gettext=0.19.8.1-r4\n\nCOPY --from=builder \"/opt/apache-artemis-${ACTIVEMQ_ARTEMIS_VERSION}\" \"/opt/apache-artemis-${ACTIVEMQ_ARTEMIS_VERSION}\"\nCOPY --from=builder \"/var/lib/artemis\" \"/var/lib/artemis\"\nCOPY --from=builder \"/opt/jmx-exporter\" \"/opt/jmx-exporter\"\nCOPY --from=builder \"/opt/jgroupskubernetes/*\" \"/opt/apache-artemis-${ACTIVEMQ_ARTEMIS_VERSION}/lib/\"\nCOPY --from=builder \"/opt/jsonformatter/*\" \"/opt/apache-artemis-${ACTIVEMQ_ARTEMIS_VERSION}/lib/\"\n\n# To enable RESTORE_CONFIGURATION\nCOPY --from=builder \"/var/lib/artemis/etc\" \"/var/lib/artemis/etc-backup\"\n\nRUN ln -s \"/opt/apache-artemis-${ACTIVEMQ_ARTEMIS_VERSION}\" /opt/apache-artemis\nRUN chown -R artemis.artemis /var/lib/artemis \nRUN chown -R artemis.artemis /opt/jmx-exporter\n\nRUN mkdir -p /opt/assets\nCOPY assets/merge.xslt /opt/assets\nCOPY assets/enable-jmx.xml /opt/assets\nCOPY assets/semver2.sh /usr/local/bin/semver\n\n# Web Server\nEXPOSE 8161\n\n# JMX Exporter\nEXPOSE 9404\n\n# Port for CORE,MQTT,AMQP,HORNETQ,STOMP,OPENWIRE\nEXPOSE 61616\n\n# Port for HORNETQ,STOMP\nEXPOSE 5445\n\n# Port for AMQP\nEXPOSE 5672\n\n# Port for MQTT\nEXPOSE 1883\n\n#Port for STOMP\nEXPOSE 61613\n\nWORKDIR /var/lib/artemis/bin\n\nUSER artemis\n\nRUN mkdir /var/lib/artemis/lock\n\n# Expose some outstanding folders\nVOLUME [\"/var/lib/artemis/data\"]\nVOLUME [\"/var/lib/artemis/tmp\"]\nVOLUME [\"/var/lib/artemis/etc\"]\nVOLUME [\"/var/lib/artemis/etc-override\"]\nVOLUME [\"/var/lib/artemis/lock\"]\n\nCOPY assets/docker-entrypoint.sh /\nENTRYPOINT [\"/docker-entrypoint.sh\"]\nCMD [\"artemis-server\"]\n"
  },
  {
    "path": "src/assets/docker-entrypoint.sh",
    "content": "#!/bin/sh\nset -e\n\nBROKER_HOME=/var/lib/artemis\nOVERRIDE_PATH=$BROKER_HOME/etc-override\nCONFIG_PATH=$BROKER_HOME/etc\nexport BROKER_HOME OVERRIDE_PATH CONFIG_PATH\n\n# Prepends a value in the JAVA_ARGS of artemis.profile\n# $1 New string to be prepended to JAVA_ARGS\n# $2 Deduplication string\nprepend_java_arg() {\n  sed -i \"\\#$1#!s#^\\([[:space:]]\\)*JAVA_ARGS=\\\"#\\\\1JAVA_ARGS=\\\"$2 #g\" $CONFIG_PATH/artemis.profile\n}\n\n# Returns true if the semver version in $1 is greater \n# of equal than the one passed in $2\n# $1 input version\n# $2 comparison version\nsemver_greater_or_equal_than() {\n  # shellcheck disable=SC2046\n  test $(semver \"${1}\" \"${2}\") -ge 0\n  return \n}\n\n# In case this is running in a non standard system that automounts\n# empty volumes like OpenShift, restore the configuration into the \n# volume\nif [ \"$RESTORE_CONFIGURATION\" ] && [ -z \"$(ls -A ${CONFIG_PATH})\" ]; then\n  cp -R \"${CONFIG_PATH}\"-backup/* \"${CONFIG_PATH}\"\n  echo Configuration restored\nfi\n\n# Update logger if the argument is passed\nif [ \"$LOG_FORMATTER\" = \"JSON\" ]; then\n    sed -i \"s/handler.CONSOLE.formatter=.*/handler.CONSOLE.formatter=JSON/g\" ../etc/logging.properties\nfi\n\n# Never use in a production environment\nif [ \"$DISABLE_SECURITY\" ]; then\n    xmlstarlet ed -L \\\n      -N activemq=\"urn:activemq\" \\\n      -N core=\"urn:activemq:core\" \\\n      --subnode \"/activemq:configuration/core:core[not(core:security-enabled)]\" \\\n      -t elem \\\n      -n \"security-enabled\" \\\n      -v \"false\" ../etc/broker.xml \nfi\n\n# Set the broker name to the host name to ease experience for external monitors and the console\nif semver_greater_or_equal_than \"${ACTIVEMQ_ARTEMIS_VERSION}\" 1.3.0 ; then\n  xmlstarlet ed -L \\\n    -N activemq=\"urn:activemq\" \\\n    -N core=\"urn:activemq:core\" \\\n    -u \"/activemq:configuration/core:core/core:name\" \\\n    -v \"$(hostname)\" ../etc/broker.xml\nfi\n\n# Update users and roles with if username and password is passed as argument\nif [ \"$ARTEMIS_USERNAME\" ] && [ \"$ARTEMIS_PASSWORD\" ]; then\n\n  # Roles update\n\n  # 2.0.0 and later are set using the cli with a running broker\n  if semver_greater_or_equal_than \"${ACTIVEMQ_ARTEMIS_VERSION}\" 1.2.0 ; then\n    # From 1.2.0 on became group=users and we still set it with sed\n    sed -i \"s/amq[ ]*=.*/amq=$ARTEMIS_USERNAME\\\\n/g\" ../etc/artemis-roles.properties\n  else\n    # From 1.0.0 up to 1.1.0 the artemis roles file was user=groups\n    sed -i \"s/artemis=amq/$ARTEMIS_USERNAME=amq\\\\n/g\" ../etc/artemis-roles.properties\n  fi\n\n  # Users update\n\n  # 2.16.0 and later are set using the cli with a running broker\n  if semver_greater_or_equal_than \"${ACTIVEMQ_ARTEMIS_VERSION}\" 2.15.0 ; then\n    HASHED_PASSWORD=$(${BROKER_HOME}/bin/artemis mask --hash \"${ARTEMIS_PASSWORD}\" | cut -d \" \" -f 2)\n    sed -i \"s/artemis[ ]*=.*/$ARTEMIS_USERNAME=ENC($HASHED_PASSWORD)\\\\n/g\" ../etc/artemis-users.properties\n  elif semver_greater_or_equal_than \"${ACTIVEMQ_ARTEMIS_VERSION}\" 1.5.0 ; then\n    # 1.5.0 to 2.14.0 modified the users file directly and therefore didn't need a running broker\n    if ${BROKER_HOME}/bin/artemis user list | grep -Eq \"\\\"${INITIAL_ARTEMIS_USERNAME}\\\"\" ; then\n      $BROKER_HOME/bin/artemis user rm --user \"${INITIAL_ARTEMIS_USERNAME}\"\n    fi\n    if ${BROKER_HOME}/bin/artemis user list | grep -Eq \"\\\"${ARTEMIS_USERNAME}\\\"\" ; then\n      $BROKER_HOME/bin/artemis user rm --user \"$ARTEMIS_USERNAME\"\n    fi\n    $BROKER_HOME/bin/artemis user add --user \"$ARTEMIS_USERNAME\" --password \"$ARTEMIS_PASSWORD\" --role amq\n  else\n    # 1.0.0 to 1.4.0 modify the file directly with the old format\n    sed -i \"s/artemis[ ]*=.*/$ARTEMIS_USERNAME=$ARTEMIS_PASSWORD\\\\n/g\" ../etc/artemis-users.properties\n  fi\nfi\n\n# Update min memory if the argument is passed\nif [ \"$ARTEMIS_MIN_MEMORY\" ]; then\n  prepend_java_arg \"-Xms\" \"-Xms$ARTEMIS_MIN_MEMORY\"\nfi\n\n# Update max memory if the argument is passed\nif [ \"$ARTEMIS_MAX_MEMORY\" ]; then\n  prepend_java_arg \"-Xmx\" \"-Xmx$ARTEMIS_MAX_MEMORY\"\nfi\n\n# Support extra java opts from JAVA_OPTS env\nif [ \"$JAVA_OPTS\" ]; then\n  prepend_java_arg \"$JAVA_OPTS\" \"$JAVA_OPTS\"\nfi\n\nmergeXmlFiles() {\n  xmlstarlet tr /opt/assets/merge.xslt -s replace=true -s with=\"$2\" \"$1\" > /tmp/broker-merge.xml\n  mv /tmp/broker-merge.xml \"$3\"\n}\n\nfiles=$(find $OVERRIDE_PATH -name \"broker*\" -type f | sort -u );\nif [ ${#files[@]} ]; then\n  for f in $files; do\n    fnoext=${f%.*}\n    if [ -f \"$fnoext.xslt\" ]; then\n      xmlstarlet tr \"$fnoext.xslt\" $CONFIG_PATH/broker.xml > /tmp/broker-tr.xml\n      mv /tmp/broker-tr.xml $CONFIG_PATH/broker.xml\n    fi\n    if [ -f \"$fnoext.xml\" ]; then\n      mergeXmlFiles \"$CONFIG_PATH/broker.xml\" \"$fnoext.xml\" \"$CONFIG_PATH/broker.xml\"\n    fi\n  done\nelse\n  echo No configuration snippets found\nfi\n\nif [ \"$ENABLE_JMX\" ] || [ \"$ENABLE_JMX_EXPORTER\" ]; then\n  prepend_java_arg \"com.sun.management.jmxremote\" \"-Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.port=${JMX_PORT:-1099} -Dcom.sun.management.jmxremote.rmi.port=${JMX_RMI_PORT:-1098} -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false\"\n  mergeXmlFiles \"$CONFIG_PATH/broker.xml\" /opt/assets/enable-jmx.xml \"$CONFIG_PATH/broker.xml\"\nfi\n\nif [ \"$ENABLE_JMX_EXPORTER\" ]; then\n  if [ -f /opt/jmx-exporter/etc-override/jmx-exporter-config.yaml ]; then\n    cp /opt/jmx-exporter/etc-override/jmx-exporter-config.yaml /opt/jmx-exporter/etc/jmx-exporter-config.yaml\n  fi\n  prepend_java_arg \"jmx_prometheus_javaagent.jar\" \"-javaagent:\\\\/opt\\\\/jmx-exporter\\\\/jmx_prometheus_javaagent.jar=9404:\\\\/opt\\\\/jmx-exporter\\\\/etc\\\\/jmx-exporter-config.yaml\"\nfi\n\nif [ -n \"$CRITICAL_ANALYZER\" ]; then\n  xmlstarlet ed -L \\\n    -N activemq=\"urn:activemq\" \\\n    -N core=\"urn:activemq:core\" \\\n    -u \"/activemq:configuration/core:core/core:critical-analyzer\" \\\n    -v \"$CRITICAL_ANALYZER\" ../etc/broker.xml\nfi\n\nif [ -n \"$CRITICAL_ANALYZER_TIMEOUT\" ]; then\n  xmlstarlet ed -L \\\n    -N activemq=\"urn:activemq\" \\\n    -N core=\"urn:activemq:core\" \\\n    -u \"/activemq:configuration/core:core/core:critical-analyzer-timeout\" \\\n    -v \"${CRITICAL_ANALYZER_TIMEOUT}\" ../etc/broker.xml\nfi\n\nif [ -n \"$CRITICAL_ANALYZER_CHECK_PERIOD\" ]; then\n  xmlstarlet ed -L \\\n    -N activemq=\"urn:activemq\" \\\n    -N core=\"urn:activemq:core\" \\\n    -u \"/activemq:configuration/core:core/core:critical-analyzer-check-period\" \\\n    -v \"${CRITICAL_ANALYZER_CHECK_PERIOD}\" ../etc/broker.xml\nfi\n\nif [ -n \"$CRITICAL_ANALYZER_POLICY\" ]; then\n  xmlstarlet ed -L \\\n    -N activemq=\"urn:activemq\" \\\n    -N core=\"urn:activemq:core\" \\\n    -u \"/activemq:configuration/core:core/core:critical-analyzer-policy\" \\\n    -v \"${CRITICAL_ANALYZER_POLICY}\" ../etc/broker.xml\nfi\n\nif [ -e /var/lib/artemis/etc/jolokia-access.xml ]; then\n  xmlstarlet ed --inplace -u '/restrict/cors/allow-origin' -v \"${JOLOKIA_ALLOW_ORIGIN:-*}\" /var/lib/artemis/etc/jolokia-access.xml\nfi\n\nperformanceJournal() {\n  perfJournalConfiguration=${ARTEMIS_PERF_JOURNAL:-AUTO}\n  if [ \"$perfJournalConfiguration\" = \"AUTO\" ] || [ \"$perfJournalConfiguration\" = \"ALWAYS\" ]; then\n\n    if [ \"$perfJournalConfiguration\" = \"AUTO\" ] && [ -e /var/lib/artemis/data/.perf-journal-completed ]; then\n      echo \"Volume's journal buffer already fine tuned\"\n      return\n    fi\n\n    echo \"Calculating performance journal ... \"\n    RECOMMENDED_JOURNAL_BUFFER=$(\"./artemis\" \"perf-journal\" | grep \"<journal-buffer-timeout\" | xmlstarlet sel -t -c '/journal-buffer-timeout/text()' || true)\n    if [ -z \"$RECOMMENDED_JOURNAL_BUFFER\" ]; then\n      echo \"There was an error calculating the performance journal, gracefully handling it\"\n      return\n    fi\n\n    xmlstarlet ed -L \\\n      -N activemq=\"urn:activemq\" \\\n      -N core=\"urn:activemq:core\" \\\n      -u \"/activemq:configuration/core:core/core:journal-buffer-timeout\" \\\n      -v \"$RECOMMENDED_JOURNAL_BUFFER\" ../etc/broker.xml\n      echo \"$RECOMMENDED_JOURNAL_BUFFER\"\n\n    if [ \"$perfJournalConfiguration\" = \"AUTO\" ]; then\n      touch /var/lib/artemis/data/.perf-journal-completed\n    fi\n  else\n    echo \"Skipping performance journal tuning as per user request\"\n  fi\n}\n\nif semver_greater_or_equal_than \"${ACTIVEMQ_ARTEMIS_VERSION}\" 1.5.3 ; then \n  performanceJournal\nelse\n  echo \"Ignoring any performance journal parameter as version predates it: ${ACTIVEMQ_ARTEMIS_VERSION}\"\nfi\n\n# Add BROKER_CONFIGS env variable to startup options\nprepend_java_arg \"BROKER_CONFIGS\" \"\\$BROKER_CONFIGS\"\n\n# Loop through all BROKER_CONFIG_... and convert to java system properties\nenv|grep -E \"^BROKER_CONFIG_\"|sed -e 's/BROKER_CONFIG_//g' >/tmp/brokerconfigs.txt\nwhile read -r config\ndo\n  PARAM=${config%%=*}\n  PARAM_CAMEL_CASE=$(echo \"$PARAM\"|sed -r 's/./\\L&/g; s/(^|-|_)(\\w)/\\U\\2/g; s/./\\L&/')\n  VALUE=${config#*=}\n  BROKER_CONFIGS=\"${BROKER_CONFIGS} -Dbrokerconfig.${PARAM_CAMEL_CASE}=${VALUE}\"\ndone < /tmp/brokerconfigs.txt\nrm -f /tmp/brokerconfigs.txt\nexport BROKER_CONFIGS\n\nfiles=$(find $OVERRIDE_PATH -name \"entrypoint*.sh\" -type f | sort -u );\nif [ ${#files[@]} ]; then\n  for f in $files; do\n    echo \"Processing entrypoint override: $f\"\n    /bin/sh \"$f\"\n  done\nfi\n\nif [ \"$1\" = 'artemis-server' ]; then\n  exec dumb-init -- sh ./artemis run\nfi\n\nexec \"$@\"\n"
  },
  {
    "path": "src/assets/enable-jmx.xml",
    "content": "<?xml version=\"1.0\"?>\n\n<configuration xmlns=\"urn:activemq\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:activemq /schema/artemis-configuration.xsd\">\n\n  <core xmlns=\"urn:activemq:core\">\n    <jmx-management-enabled>true</jmx-management-enabled>\n  </core>\n\n</configuration>\n"
  },
  {
    "path": "src/assets/jmx-exporter-config.yaml",
    "content": "---\nlowercaseOutputName: true\nlowercaseOutputLabelNames: true\nrules:\n  - pattern: \"^org.apache.activemq.artemis<broker=\\\"([^\\\"]*)\\\"><>([^:]*):\\\\s(.*)\"\n    attrNameSnakeCase: true\n    name: artemis_$2\n    type: COUNTER\n  - pattern: \"^org.apache.activemq.artemis<broker=\\\"([^\\\"]*)\\\",\\\\s*component=addresses,\\\\s*address=\\\"([^\\\"]*)\\\"><>([^:]*):\\\\s(.*)\"\n    attrNameSnakeCase: true\n    name: artemis_$3\n    type: COUNTER\n    labels:\n        address: $2\n  - pattern: \"^org.apache.activemq.artemis<broker=\\\"([^\\\"]*)\\\",\\\\s*component=addresses,\\\\s*address=\\\"([^\\\"]*)\\\",\\\\s*subcomponent=(queue|topic)s,\\\\s*routing-type=\\\"([^\\\"]*)\\\",\\\\s*(queue|topic)=\\\"([^\\\"]*)\\\"><>([^: ]*):\\\\s(.*)\"\n    attrNameSnakeCase: true\n    name: artemis_$7\n    type: COUNTER\n    labels:\n        address: $2\n        \"$5\": $6\n"
  },
  {
    "path": "src/assets/merge.xslt",
    "content": "<?xml version=\"1.0\"?>\n\n<!--\n   Merging two XML files\n   Version 1.6\n   LGPL (c) Oliver Becker, 2002-07-05\n   obecker@informatik.hu-berlin.de\n-->\n\n<xslt:transform version=\"1.0\"\n                xmlns:xslt=\"http://www.w3.org/1999/XSL/Transform\"\n                xmlns:m=\"http://informatik.hu-berlin.de/merge\"\n                exclude-result-prefixes=\"m\">\n\n\n<!-- Normalize the contents of text, comment, and processing-instruction\n     nodes before comparing?\n     Default: yes -->\n<xslt:param name=\"normalize\" select=\"'yes'\" />\n\n<!-- Don't merge elements with this (qualified) name -->\n<xslt:param name=\"dontmerge\" />\n\n<!-- If set to true, text nodes in file1 will be replaced -->\n<xslt:param name=\"replace\" select=\"false()\" />\n\n<!-- Variant 1: Source document looks like\n     <?xml version=\"1.0\"?>\n     <merge xmlns=\"http://informatik.hu-berlin.de/merge\">\n        <file1>file1.xml</file1>\n        <file2>file2.xml</file2>\n     </merge>\n     The transformation sheet merges file1.xml and file2.xml.\n-->\n<xslt:template match=\"m:merge\" >\n   <xslt:variable name=\"file1\" select=\"string(m:file1)\" />\n   <xslt:variable name=\"file2\" select=\"string(m:file2)\" />\n   <xslt:message>\n      <xslt:text />Merging '<xslt:value-of select=\"$file1\" />\n      <xslt:text />' and '<xslt:value-of select=\"$file2\"/>'<xslt:text />\n   </xslt:message>\n   <xslt:if test=\"$file1='' or $file2=''\">\n      <xslt:message terminate=\"yes\">\n         <xslt:text>No files to merge specified</xslt:text>\n      </xslt:message>\n   </xslt:if>\n   <xslt:call-template name=\"m:merge\">\n      <xslt:with-param name=\"nodes1\" select=\"document($file1,/*)/node()\" />\n      <xslt:with-param name=\"nodes2\" select=\"document($file2,/*)/node()\" />\n   </xslt:call-template>\n</xslt:template>\n\n\n<!-- Variant 2:\n     The transformation sheet merges the source document with the\n     document provided by the parameter \"with\".\n-->\n<xslt:param name=\"with\" />\n\n<xslt:template match=\"*\">\n   <xslt:message>\n      <xslt:text />Merging input with '<xslt:value-of select=\"$with\"/>\n      <xslt:text>'</xslt:text>\n   </xslt:message>\n   <xslt:if test=\"string($with)=''\">\n      <xslt:message terminate=\"yes\">\n         <xslt:text>No input file specified (parameter 'with')</xslt:text>\n      </xslt:message>\n   </xslt:if>\n\n   <xslt:call-template name=\"m:merge\">\n      <xslt:with-param name=\"nodes1\" select=\"/node()\" />\n      <xslt:with-param name=\"nodes2\" select=\"document($with,/*)/node()\" />\n   </xslt:call-template>\n</xslt:template>\n\n\n<!-- ============================================================== -->\n\n<!-- The \"merge\" template -->\n<xslt:template name=\"m:merge\">\n   <xslt:param name=\"nodes1\" />\n   <xslt:param name=\"nodes2\" />\n\n   <xslt:choose>\n      <!-- Is $nodes1 resp. $nodes2 empty? -->\n      <xslt:when test=\"count($nodes1)=0\">\n         <xslt:copy-of select=\"$nodes2\" />\n      </xslt:when>\n      <xslt:when test=\"count($nodes2)=0\">\n         <xslt:copy-of select=\"$nodes1\" />\n      </xslt:when>\n\n      <xslt:otherwise>\n         <!-- Split $nodes1 and $nodes2 -->\n         <xslt:variable name=\"first1\" select=\"$nodes1[1]\" />\n         <xslt:variable name=\"rest1\" select=\"$nodes1[position()!=1]\" />\n         <xslt:variable name=\"first2\" select=\"$nodes2[1]\" />\n         <xslt:variable name=\"rest2\" select=\"$nodes2[position()!=1]\" />\n         <!-- Determine type of node $first1 -->\n         <xslt:variable name=\"type1\">\n            <xslt:apply-templates mode=\"m:detect-type\" select=\"$first1\" />\n         </xslt:variable>\n\n         <!-- Compare $first1 and $first2 -->\n         <xslt:variable name=\"diff-first\">\n            <xslt:call-template name=\"m:compare-nodes\">\n               <xslt:with-param name=\"node1\" select=\"$first1\" />\n               <xslt:with-param name=\"node2\" select=\"$first2\" />\n            </xslt:call-template>\n         </xslt:variable>\n\n         <xslt:choose>\n            <!-- $first1 != $first2 -->\n            <xslt:when test=\"$diff-first='!'\">\n               <!-- Compare $first1 and $rest2 -->\n               <xslt:variable name=\"diff-rest\">\n                  <xslt:for-each select=\"$rest2\">\n                     <xslt:call-template name=\"m:compare-nodes\">\n                        <xslt:with-param name=\"node1\" select=\"$first1\" />\n                        <xslt:with-param name=\"node2\" select=\".\" />\n                     </xslt:call-template>\n                  </xslt:for-each>\n               </xslt:variable>\n\n               <xslt:choose>\n                  <!-- $first1 is in $rest2 and\n                       $first1 is *not* an empty text node  -->\n                  <xslt:when test=\"contains($diff-rest,'=') and\n                                      not($type1='text' and\n                                          normalize-space($first1)='')\">\n                     <!-- determine position of $first1 in $nodes2\n                          and copy all preceding nodes of $nodes2 -->\n                     <xslt:variable name=\"pos\"\n                           select=\"string-length(substring-before(\n                                                $diff-rest,'=')) + 2\" />\n                     <xslt:copy-of\n                           select=\"$nodes2[position() &lt; $pos]\" />\n                     <!-- merge $first1 with its equivalent node -->\n                     <xslt:choose>\n                        <!-- Elements: merge -->\n                        <xslt:when test=\"$type1='element'\">\n                           <xslt:element name=\"{name($first1)}\"\n                                         namespace=\"{namespace-uri($first1)}\">\n                              <xslt:copy-of select=\"$first1/namespace::*\" />\n                              <xslt:copy-of select=\"$first2/namespace::*\" />\n                              <xslt:copy-of select=\"$first1/@*\" />\n                              <xslt:call-template name=\"m:merge\">\n                                 <xslt:with-param name=\"nodes1\"\n                                       select=\"$first1/node()\" />\n                                 <xslt:with-param name=\"nodes2\"\n                                       select=\"$nodes2[position()=$pos]/node()\" />\n                              </xslt:call-template>\n                           </xslt:element>\n                        </xslt:when>\n                        <!-- Other: copy -->\n                        <xslt:otherwise>\n                           <xslt:copy-of select=\"$first1\" />\n                        </xslt:otherwise>\n                     </xslt:choose>\n\n                     <!-- Merge $rest1 and rest of $nodes2 -->\n                     <xslt:call-template name=\"m:merge\">\n                        <xslt:with-param name=\"nodes1\" select=\"$rest1\" />\n                        <xslt:with-param name=\"nodes2\"\n                              select=\"$nodes2[position() &gt; $pos]\" />\n                     </xslt:call-template>\n                  </xslt:when>\n\n                  <!-- $first1 is a text node and replace mode was\n                       activated -->\n                  <xslt:when test=\"$type1='text' and $replace\">\n                     <xslt:call-template name=\"m:merge\">\n                        <xslt:with-param name=\"nodes1\" select=\"$rest1\" />\n                        <xslt:with-param name=\"nodes2\" select=\"$nodes2\" />\n                     </xslt:call-template>\n                  </xslt:when>\n\n                  <!-- else: $first1 is not in $rest2 or\n                       $first1 is an empty text node -->\n                  <xslt:otherwise>\n                     <xslt:copy-of select=\"$first1\" />\n                     <xslt:call-template name=\"m:merge\">\n                        <xslt:with-param name=\"nodes1\" select=\"$rest1\" />\n                        <xslt:with-param name=\"nodes2\" select=\"$nodes2\" />\n                     </xslt:call-template>\n                  </xslt:otherwise>\n               </xslt:choose>\n            </xslt:when>\n\n            <!-- else: $first1 = $first2 -->\n            <xslt:otherwise>\n               <xslt:choose>\n                  <!-- Elements: merge -->\n                  <xslt:when test=\"$type1='element'\">\n                     <xslt:element name=\"{name($first1)}\"\n                                   namespace=\"{namespace-uri($first1)}\">\n                        <xslt:copy-of select=\"$first1/namespace::*\" />\n                        <xslt:copy-of select=\"$first2/namespace::*\" />\n                        <xslt:copy-of select=\"$first1/@*\" />\n                        <xslt:call-template name=\"m:merge\">\n                           <xslt:with-param name=\"nodes1\"\n                                            select=\"$first1/node()\" />\n                           <xslt:with-param name=\"nodes2\"\n                                            select=\"$first2/node()\" />\n                        </xslt:call-template>\n                     </xslt:element>\n                  </xslt:when>\n                  <!-- Other: copy -->\n                  <xslt:otherwise>\n                     <xslt:copy-of select=\"$first1\" />\n                  </xslt:otherwise>\n               </xslt:choose>\n\n               <!-- Merge $rest1 and $rest2 -->\n               <xslt:call-template name=\"m:merge\">\n                  <xslt:with-param name=\"nodes1\" select=\"$rest1\" />\n                  <xslt:with-param name=\"nodes2\" select=\"$rest2\" />\n               </xslt:call-template>\n            </xslt:otherwise>\n         </xslt:choose>\n      </xslt:otherwise>\n   </xslt:choose>\n</xslt:template>\n\n\n<!-- Comparing single nodes:\n     if $node1 and $node2 are equivalent then the template creates a\n     text node \"=\" otherwise a text node \"!\" -->\n<xslt:template name=\"m:compare-nodes\">\n   <xslt:param name=\"node1\" />\n   <xslt:param name=\"node2\" />\n   <xslt:variable name=\"type1\">\n      <xslt:apply-templates mode=\"m:detect-type\" select=\"$node1\" />\n   </xslt:variable>\n   <xslt:variable name=\"type2\">\n      <xslt:apply-templates mode=\"m:detect-type\" select=\"$node2\" />\n   </xslt:variable>\n\n   <xslt:choose>\n      <!-- Are $node1 and $node2 element nodes with the same name? -->\n      <xslt:when test=\"$type1='element' and $type2='element' and\n                       local-name($node1)=local-name($node2) and\n                       namespace-uri($node1)=namespace-uri($node2) and\n                       name($node1)!=$dontmerge and name($node2)!=$dontmerge\">\n         <!-- Comparing the attributes -->\n         <xslt:variable name=\"diff-att\">\n            <!-- same number ... -->\n            <xslt:if test=\"count($node1/@*)!=count($node2/@*)\">.</xslt:if>\n            <!-- ... and same name/content -->\n            <xslt:for-each select=\"$node1/@*\">\n               <xslt:if test=\"not($node2/@*\n                        [local-name()=local-name(current()) and\n                         namespace-uri()=namespace-uri(current()) and\n                         .=current()])\">.</xslt:if>\n            </xslt:for-each>\n         </xslt:variable>\n         <xslt:choose>\n            <xslt:when test=\"string-length($diff-att)!=0\">!</xslt:when>\n            <xslt:otherwise>=</xslt:otherwise>\n         </xslt:choose>\n      </xslt:when>\n\n      <!-- Other nodes: test for the same type and content -->\n      <xslt:when test=\"$type1!='element' and $type1=$type2 and\n                       name($node1)=name($node2) and\n                       ($node1=$node2 or\n                          ($normalize='yes' and\n                           normalize-space($node1)=\n                           normalize-space($node2)))\">=</xslt:when>\n\n      <!-- Otherwise: different node types or different name/content -->\n      <xslt:otherwise>!</xslt:otherwise>\n   </xslt:choose>\n</xslt:template>\n\n\n<!-- Type detection, thanks to M. H. Kay -->\n<xslt:template match=\"*\" mode=\"m:detect-type\">element</xslt:template>\n<xslt:template match=\"text()\" mode=\"m:detect-type\">text</xslt:template>\n<xslt:template match=\"comment()\" mode=\"m:detect-type\">comment</xslt:template>\n<xslt:template match=\"processing-instruction()\" mode=\"m:detect-type\">pi</xslt:template>\n\n</xslt:transform>\n"
  },
  {
    "path": "src/assets/semver2.sh",
    "content": "#!/bin/sh\n\n# POSIX SH portable semver 2.0 comparition tool.\n\n# This bash script compares pre-releases alphabetically as well (number < lowerCaseLetter < upperCaseLetter)\n#\n# returns 1 when A greater than B\n# returns 0 when A equals B\n# returns -1 when A lower than B\n#\n# Usage\n# chmod +x semver.sh\n# ./semver.sh 1.0.0-rc.0.a+metadata v1.0.0-rc.0+metadata\n# --> 1\n#\n\n# This software was built with the help of the following sources:\n# https://stackoverflow.com/a/58067270\n# https://www.unix.com/man-page/posix/1posix/cut/\n# https://stackoverflow.com/questions/51052475/how-to-iterate-over-the-characters-of-a-string-in-a-posix-shell-script\n\nset -eu\n\ndebug() {\n  if [ \"$debug\" = \"debug\" ]; then printf \"DEBUG: %s$1 \\n\"; fi\n}\n\n# params char\n# returns Integer\nord() {\n  printf '%d' \"'$1\"\n}\n\n\nisNumber() {\n  string=$1\n  char=\"\"\n  while true; do\n    substract=\"${string#?}\"    # All but the first character of the string\n    char=\"${string%\"$substract\"}\"    # Remove $rest, and you're left with the first character\n    string=\"$substract\"\n    # no more chars to compare then success\n    if [ -z \"$char\" ]; then\n      printf \"true\"\n      return 1\n    fi\n    # break if some of the chars is not a number\n    if [ \"$(ord \"$char\")\" -lt 48 ] || [ \"$(ord \"$char\")\" -gt 57 ]; then\n      printf \"false\"\n      return 0\n    fi\n  done\n}\n\n# params string {String}, Index {Number}\n# returns char\ngetChar() {\n  string=$1\n  index=$2\n  cursor=-1\n  char=\"\"\n  while [ \"$cursor\" != \"$index\" ]; do\n    substract=\"${string#?}\"    # All but the first character of the string\n    char=\"${string%\"$substract\"}\"    # Remove $rest, and you're left with the first character\n    string=\"$substract\"\n    cursor=$((cursor + 1))\n  done\n  printf \"%s$char\"\n}\n\noutcome() {\n  result=$1\n  printf \"%s$result\\n\"\n}\n\n\ncompareNumber() {\n  if [ -z \"$1\" ] && [ -z \"$2\" ]; then\n    printf \"%s\" \"0\"\n    return\n  fi\n\n  [ $(($2 - $1)) -gt 0 ] && printf \"%s\" \"-1\"\n  [ $(($2 - $1)) -lt 0 ] && printf \"1\"\n  [ $(($2 - $1)) = 0 ] && printf \"0\"\n}\n\ncompareString() {\n  result=false\n  index=0\n  while true\n  do\n    a=$(getChar \"$1\" $index)\n    b=$(getChar \"$2\" $index)\n\n    if [ -z \"$a\" ] && [ -z \"$b\" ]\n    then\n      printf \"0\"\n      return\n    fi\n\n    ord_a=$(ord \"$a\")\n    ord_b=$(ord \"$b\")\n  \n    if [ \"$(compareNumber \"$ord_a\" \"$ord_b\")\" != \"0\" ]; then\n      printf \"%s\" \"$(compareNumber \"$ord_a\" \"$ord_b\")\"\n      return\n    fi\n\n    index=$((index + 1))\n  done\n}\n\nincludesString() {\n  string=\"$1\"\n  substring=\"$2\"\n  if [ \"${string#*$substring}\" != \"$string\" ]\n  then\n    printf \"1\"\n    return 1    # $substring is in $string\n  fi\n  printf \"0\"\n  return 0    # $substring is not in $string\n}\n\nremoveLeadingV() {\n  printf \"%s${1#v}\"\n}\n\nsemver_compare() {\n  firstParam=$1 #1.2.4-alpha.beta+METADATA\n  secondParam=$2 #1.2.4-alpha.beta.2+METADATA\n  debug=${3:-1}\n  verbose=${4:-1}\n\n  [ \"$verbose\" = \"verbose\" ] && set -x\n\n  version_a=$(printf %s \"$firstParam\" | cut -d'+' -f 1)\n  version_a=$(removeLeadingV \"$version_a\")\n  version_b=$(printf %s \"$secondParam\" | cut -d'+' -f 1)\n  version_b=$(removeLeadingV \"$version_b\")\n\n  a_major=$(printf %s \"$version_a\" | cut -d'.' -f 1)\n  a_minor=$(printf %s \"$version_a\" | cut -d'.' -f 2)\n  a_patch=$(printf %s \"$version_a\" | cut -d'.' -f 3 | cut -d'-' -f 1)\n  a_pre=\"\"\n  if [ \"$(includesString \"$version_a\" -)\" = 1 ]; then\n    a_pre=$(printf %s\"${version_a#$a_major.$a_minor.$a_patch-}\")\n  fi\n\n  b_major=$(printf %s \"$version_b\" | cut -d'.' -f 1)\n  b_minor=$(printf %s \"$version_b\" | cut -d'.' -f 2)\n  b_patch=$(printf %s \"$version_b\" | cut -d'.' -f 3 | cut -d'-' -f 1)\n  b_pre=\"\"\n  if [ \"$(includesString \"$version_b\" -)\" = 1 ]; then\n    b_pre=$(printf %s\"${version_b#$b_major.$b_minor.$b_patch-}\")\n  fi\n\n  unit_types=\"MAJOR MINOR PATCH\"\n  a_normalized=\"$a_major $a_minor $a_patch\"\n  b_normalized=\"$b_major $b_minor $b_patch\"\n\n  debug \"Detected: $a_major $a_minor $a_patch identifiers: $a_pre\"\n  debug \"Detected: $b_major $b_minor $b_patch identifiers: $b_pre\"\n  \n  #####\n  #\n  # Find difference between Major Minor or Patch\n  #\n\n  cursor=1\n  while [ \"$cursor\" -lt 4 ]\n  do\n    a=$(printf %s \"$a_normalized\" | cut -d' ' -f $cursor)\n    b=$(printf %s \"$b_normalized\" | cut -d' ' -f $cursor)\n    if [ \"$a\" != \"$b\" ]\n    then\n      debug \"$(printf %s \"$unit_types\" | cut -d' ' -f $cursor) is different\"\n      outcome \"$(compareNumber \"$a\" \"$b\")\"\n      return\n    fi;\n    debug \"$(printf \"%s\" \"$unit_types\" | cut -d' ' -f $cursor) are equal\"\n    cursor=$((cursor + 1))\n  done\n\n  #####\n  #\n  # Find difference between pre release identifiers\n  #\n\n  if [ -z \"$a_pre\" ] && [ -z \"$b_pre\" ]; then\n    debug \"Because both are equals\"\n    outcome \"0\"\n    return\n  fi\n\n  # Spec 11.3 a pre-release version has lower precedence than a normal version:\n  # Example: 1.0.0-alpha < 1.0.0.\n\n  if [ -z \"$a_pre\" ]; then\n    debug \"Because a pre-release version has lower precedence than a normal version\"\n    outcome \"1\"\n    return\n  fi\n\n  if [ -z \"$b_pre\" ]; then\n    debug \"Because a pre-release version has lower precedence than a normal version\"\n    outcome \"-1\"\n    return\n  fi\n\n\n  isSingleIdentifier() {\n    substract=\"${2#?}\"\n    if [ \"${1%\"$2\"}\" = \"\" ]; then\n      printf \"true\"\n      return 1;\n    fi\n    return 0\n  }\n\n  cursor=1\n  while [ $cursor -lt 4 ]\n  do\n    a=$(printf %s \"$a_pre\" | cut -d'.' -f $cursor)\n    b=$(printf %s \"$b_pre\" | cut -d'.' -f $cursor)\n    \n    debug \"Comparing identifier $a with $b\"\n\n    # Exit when there is nothing else to compare.\n    # Most likely because they are equals\n    if [ -z \"$a\" ] && [ -z \"$b\" ]\n    then\n      debug \"are equals\"\n      outcome \"0\"\n      return\n    fi;\n\n    # Spec #11 https://semver.org/#spec-item-11\n    # Precedence for two pre-release versions with the same major, minor, and patch version\n    # MUST be determined by comparing each dot separated identifier from left to right until a difference is found\n\n    # Spec 11.4.4: A larger set of pre-release fields has a higher precedence than a smaller set, if all of the preceding identifiers are equal.\n    if [ -n \"$a\" ] && [ -z \"$b\" ]; then\n      # When A is larger than B\n      debug \"Because A has more pre-identifiers\"\n      outcome \"1\"\n      return\n    fi\n      \n    # When A is shorter than B\n    if [ -z \"$a\" ] && [ -n \"$b\" ]; then\n      debug \"Because B has more pre-identifiers\"\n      outcome \"-1\"\n      return\n    fi\n\n    # Spec #11.4.1\n    # Identifiers consisting of only digits are compared numerically.\n    if [ \"$(isNumber \"$a\")\" = \"true\" ] || [ \"$(isNumber \"$b\")\" = \"true\" ]; then\n      \n      # if both identifiers are numbers, then compare and proceed\n      if [ \"$(isNumber \"$a\")\" = \"true\" ] && [ \"$(isNumber \"$b\")\" = \"true\" ]; then\n        if [ \"$(compareNumber \"$a\" \"$b\")\" != \"0\" ]; then\n          debug \"Number is not equal $(compareNumber \"$a\" \"$b\")\"\n          outcome \"$(compareNumber \"$a\" \"$b\")\"\n          return\n        fi\n      fi\n\n      # Spec 11.4.3\n      if [ \"$(isNumber \"$a\")\" = \"false\" ]; then\n        debug \"Because Numeric identifiers always have lower precedence than non-numeric identifiers.\"\n        outcome \"1\"\n        return\n      fi\n\n      if [ \"$(isNumber \"$b\")\" = \"false\" ]; then\n        debug \"Because Numeric identifiers always have lower precedence than non-numeric identifiers.\"\n        outcome \"-1\"\n        return\n      fi\n    else\n      # Spec 11.4.2\n      # Identifiers with letters or hyphens are compared lexically in ASCII sort order.\n      if [ \"$(compareString \"$a\" \"$b\")\" != \"0\" ]; then\n        debug \"cardinal is not equal $(compareString a b)\"\n        outcome \"$(compareString \"$a\" \"$b\")\"\n        return\n      fi\n    fi\n\n    # Edge case when there is single identifier exaple: x.y.z-beta\n    if [ \"$cursor\" = 1 ]; then\n      \n      # When both versions are single return equals\n      if [ -n \"$(isSingleIdentifier \"$b_pre\" \"$b\")\" ] && [ -n \"$(isSingleIdentifier \"$a_pre\" \"$a\")\" ]; then\n        debug \"Because both have single identifier\"\n        outcome \"0\"\n        return\n      fi\n      \n      # Return greater when has more identifiers\n      # Spec 11.4.4: A larger set of pre-release fields has a higher precedence than a smaller set, if all of the preceding identifiers are equal.\n      \n      # When A is larger than B\n      if [ -n \"$(isSingleIdentifier \"$b_pre\" \"$b\")\" ] && [ -z \"$(isSingleIdentifier \"$a_pre\" \"$a\")\" ]; then\n        debug \"Because of single identifier, A has more pre-identifiers\"\n        outcome \"1\"\n        return\n      fi\n      \n      # When A is shorter than B\n      if [ -z \"$(isSingleIdentifier \"$b_pre\" \"$b\")\" ] && [ -n \"$(isSingleIdentifier \"$a_pre\" \"$a\")\" ]; then\n        debug \"Because of single identifier, B has more pre-identifiers\"\n        outcome \"-1\"\n        return\n      fi\n    fi\n  \n    # Proceed to the next identifier because previous comparition was equal.\n    cursor=$((cursor + 1))\n  done\n}\n\nprintf \"%s$(semver_compare \"$@\")\\n\"\n"
  },
  {
    "path": "tags.csv",
    "content": "Repository,Tag,Base Image,Aliases,Dockerfile\nvromero/activemq-artemis,1.0.0,openjdk:8u232-jre-stretch,vromero/activemq-artemis:1.0-latest,Dockerfile\nvromero/activemq-artemis,1.0.0-alpine,openjdk:8u212-jre-alpine3.9,vromero/activemq-artemis:1.0-alpine-latest,Dockerfile.alpine\nvromero/activemq-artemis,1.1.0,openjdk:8u232-jre-stretch,vromero/activemq-artemis:1.1-latest,Dockerfile\nvromero/activemq-artemis,1.1.0-alpine,openjdk:8u212-jre-alpine3.9,vromero/activemq-artemis:1.1-alpine-latest,Dockerfile.alpine\nvromero/activemq-artemis,1.2.0,openjdk:8u232-jre-stretch,vromero/activemq-artemis:1.2-latest,Dockerfile\nvromero/activemq-artemis,1.2.0-alpine,openjdk:8u212-jre-alpine3.9,vromero/activemq-artemis:1.2-alpine-latest,Dockerfile.alpine\nvromero/activemq-artemis,1.3.0,openjdk:8u232-jre-stretch,vromero/activemq-artemis:1.3-latest,Dockerfile\nvromero/activemq-artemis,1.3.0-alpine,openjdk:8u212-jre-alpine3.9,vromero/activemq-artemis:1.3-alpine-latest,Dockerfile.alpine\nvromero/activemq-artemis,1.4.0,openjdk:8u232-jre-stretch,vromero/activemq-artemis:1.4-latest,Dockerfile\nvromero/activemq-artemis,1.4.0-alpine,openjdk:8u212-jre-alpine3.9,vromero/activemq-artemis:1.4-alpine-latest,Dockerfile.alpine\nvromero/activemq-artemis,1.5.0,openjdk:8u232-jre-stretch,,Dockerfile\nvromero/activemq-artemis,1.5.0-alpine,openjdk:8u212-jre-alpine3.9,,Dockerfile.alpine\nvromero/activemq-artemis,1.5.1,openjdk:8u232-jre-stretch,,Dockerfile\nvromero/activemq-artemis,1.5.1-alpine,openjdk:8u212-jre-alpine3.9,,Dockerfile.alpine\nvromero/activemq-artemis,1.5.2,openjdk:8u232-jre-stretch,,Dockerfile\nvromero/activemq-artemis,1.5.2-alpine,openjdk:8u212-jre-alpine3.9,,Dockerfile.alpine\nvromero/activemq-artemis,1.5.3,openjdk:8u232-jre-stretch,,Dockerfile\nvromero/activemq-artemis,1.5.3-alpine,openjdk:8u212-jre-alpine3.9,,Dockerfile.alpine\nvromero/activemq-artemis,1.5.4,openjdk:8u232-jre-stretch,,Dockerfile\nvromero/activemq-artemis,1.5.4-alpine,openjdk:8u212-jre-alpine3.9,,Dockerfile.alpine\nvromero/activemq-artemis,1.5.5,openjdk:8u232-jre-stretch,,Dockerfile\nvromero/activemq-artemis,1.5.5-alpine,openjdk:8u212-jre-alpine3.9,,Dockerfile.alpine\nvromero/activemq-artemis,1.5.6,openjdk:8u232-jre-stretch,vromero/activemq-artemis:1.5-latest vromero/activemq-artemis:1-latest,Dockerfile\nvromero/activemq-artemis,1.5.6-alpine,openjdk:8u212-jre-alpine3.9,vromero/activemq-artemis:1.5-alpine-latest vromero/activemq-artemis:1-alpine-latest,Dockerfile.alpine\nvromero/activemq-artemis,2.0.0,openjdk:8u232-jre-stretch,vromero/activemq-artemis:2.0-latest,Dockerfile\nvromero/activemq-artemis,2.0.0-alpine,openjdk:8u212-jre-alpine3.9,vromero/activemq-artemis:2.0-alpine-latest,Dockerfile.alpine\nvromero/activemq-artemis,2.1.0,openjdk:8u232-jre-stretch,vromero/activemq-artemis:2.1-latest,Dockerfile\nvromero/activemq-artemis,2.1.0-alpine,openjdk:8u212-jre-alpine3.9,vromero/activemq-artemis:2.1-alpine-latest,Dockerfile.alpine\nvromero/activemq-artemis,2.2.0,openjdk:8u232-jre-stretch,vromero/activemq-artemis:2.2-latest,Dockerfile\nvromero/activemq-artemis,2.2.0-alpine,openjdk:8u212-jre-alpine3.9,vromero/activemq-artemis:2.2-alpine-latest,Dockerfile.alpine\nvromero/activemq-artemis,2.3.0,openjdk:8u232-jre-stretch,vromero/activemq-artemis:2.3-latest,Dockerfile\nvromero/activemq-artemis,2.3.0-alpine,openjdk:8u212-jre-alpine3.9,vromero/activemq-artemis:2.3-alpine-latest,Dockerfile.alpine\nvromero/activemq-artemis,2.4.0,openjdk:8u232-jre-stretch,vromero/activemq-artemis:2.4-latest,Dockerfile\nvromero/activemq-artemis,2.4.0-alpine,openjdk:8u212-jre-alpine3.9,vromero/activemq-artemis:2.4-alpine-latest,Dockerfile.alpine\nvromero/activemq-artemis,2.5.0,openjdk:8u232-jre-stretch,vromero/activemq-artemis:2.5-latest,Dockerfile\nvromero/activemq-artemis,2.5.0-alpine,openjdk:8u212-jre-alpine3.9,vromero/activemq-artemis:2.5-alpine-latest,Dockerfile.alpine\nvromero/activemq-artemis,2.6.0,openjdk:8u232-jre-stretch,,Dockerfile\nvromero/activemq-artemis,2.6.0-alpine,openjdk:8u212-jre-alpine3.9,,Dockerfile.alpine\nvromero/activemq-artemis,2.6.1,openjdk:8u232-jre-stretch,,Dockerfile\nvromero/activemq-artemis,2.6.1-alpine,openjdk:8u212-jre-alpine3.9,,Dockerfile.alpine\nvromero/activemq-artemis,2.6.2,openjdk:8u232-jre-stretch,,Dockerfile\nvromero/activemq-artemis,2.6.2-alpine,openjdk:8u212-jre-alpine3.9,,Dockerfile.alpine\nvromero/activemq-artemis,2.6.3,openjdk:8u232-jre-stretch,,Dockerfile\nvromero/activemq-artemis,2.6.3-alpine,openjdk:8u212-jre-alpine3.9,,Dockerfile.alpine\nvromero/activemq-artemis,2.6.4,openjdk:8u232-jre-stretch,vromero/activemq-artemis:2.6-latest,Dockerfile\nvromero/activemq-artemis,2.6.4-alpine,openjdk:8u212-jre-alpine3.9,vromero/activemq-artemis:2.6-alpine-latest,Dockerfile.alpine\nvromero/activemq-artemis,2.7.0,openjdk:8u232-jre-stretch,vromero/activemq-artemis:2.7-latest,Dockerfile\nvromero/activemq-artemis,2.7.0-alpine,openjdk:8u212-jre-alpine3.9,vromero/activemq-artemis:2.7-alpine-latest,Dockerfile.alpine\nvromero/activemq-artemis,2.8.0,openjdk:8u232-jre-stretch,vromero/activemq-artemis:2.8-latest,Dockerfile\nvromero/activemq-artemis,2.8.0-alpine,openjdk:8u212-jre-alpine3.9,vromero/activemq-artemis:2.8-alpine-latest,Dockerfile.alpine\nvromero/activemq-artemis,2.9.0,openjdk:8u232-jre-stretch,vromero/activemq-artemis:2.9-latest,Dockerfile\nvromero/activemq-artemis,2.9.0-alpine,openjdk:8u212-jre-alpine3.9,vromero/activemq-artemis:2.9-alpine-latest,Dockerfile.alpine\nvromero/activemq-artemis,2.10.0,openjdk:8u232-jre-stretch,,Dockerfile\nvromero/activemq-artemis,2.10.0-alpine,openjdk:8u212-jre-alpine3.9,,Dockerfile.alpine\nvromero/activemq-artemis,2.10.1,openjdk:8u232-jre-stretch,vromero/activemq-artemis:2.10-latest,Dockerfile\nvromero/activemq-artemis,2.10.1-alpine,openjdk:8u212-jre-alpine3.9,vromero/activemq-artemis:2.10-alpine-latest,Dockerfile.alpine\nvromero/activemq-artemis,2.11.0,openjdk:8u232-jre-stretch,vromero/activemq-artemis:2.11-latest,Dockerfile\nvromero/activemq-artemis,2.11.0-alpine,openjdk:8u212-jre-alpine3.9,vromero/activemq-artemis:2.11-alpine-latest,Dockerfile.alpine\nvromero/activemq-artemis,2.12.0,openjdk:8u232-jre-stretch,vromero/activemq-artemis:2.12-latest,Dockerfile\nvromero/activemq-artemis,2.12.0-alpine,openjdk:8u212-jre-alpine3.9,vromero/activemq-artemis:2.12-alpine-latest,Dockerfile.alpine\nvromero/activemq-artemis,2.13.0,openjdk:8u232-jre-stretch,vromero/activemq-artemis:2.13-latest,Dockerfile\nvromero/activemq-artemis,2.13.0-alpine,openjdk:8u212-jre-alpine3.9,vromero/activemq-artemis:2.13-alpine-latest,Dockerfile.alpine\nvromero/activemq-artemis,2.14.0,openjdk:8u232-jre-stretch,vromero/activemq-artemis:2.14-latest,Dockerfile\nvromero/activemq-artemis,2.14.0-alpine,openjdk:8u212-jre-alpine3.9,vromero/activemq-artemis:2.14-alpine-latest,Dockerfile.alpine\nvromero/activemq-artemis,2.15.0,openjdk:8u232-jre-stretch,vromero/activemq-artemis:2.15-latest,Dockerfile\nvromero/activemq-artemis,2.15.0-alpine,openjdk:8u212-jre-alpine3.9,vromero/activemq-artemis:2.15-alpine-latest,Dockerfile.alpine\nvromero/activemq-artemis,2.16.0,openjdk:8u232-jre-stretch,vromero/activemq-artemis:2.16-latest vromero/activemq-artemis:2-latest vromero/activemq-artemis:latest,Dockerfile\nvromero/activemq-artemis,2.16.0-alpine,openjdk:8u212-jre-alpine3.9,vromero/activemq-artemis:2.16-alpine-latest vromero/activemq-artemis:2-alpine-latest vromero/activemq-artemis:alpine-latest,Dockerfile.alpine\n"
  },
  {
    "path": "test/assets/1.x.x/etc-override/broker-00.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n\n<configuration xmlns=\"urn:activemq\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:activemq /schema/artemis-configuration.xsd\">\n  <core xmlns=\"urn:activemq:core\">\n      <security-enabled>false</security-enabled>\n   </core>\n</configuration>\n"
  },
  {
    "path": "test/assets/1.x.x/etc-override/entrypoint-00.sh",
    "content": "#!/bin/sh\ntouch /var/lib/artemis/etc/created_by_entrypoint-00"
  },
  {
    "path": "test/assets/2.x.x/etc-override/broker-00.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n\n<configuration xmlns=\"urn:activemq\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:activemq /schema/artemis-configuration.xsd\">\n   <core xmlns=\"urn:activemq:core\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:activemq:core \">\n      <security-enabled>false</security-enabled>\n   </core>\n</configuration>\n"
  },
  {
    "path": "test/assets/2.x.x/etc-override/entrypoint-00.sh",
    "content": "#!/bin/sh\ntouch /var/lib/artemis/etc/created_by_entrypoint-00"
  },
  {
    "path": "test/assets/etc-override/jmx-exporter-config.yaml",
    "content": "---\nlowercaseOutputName: true\nlowercaseOutputLabelNames: true\nrules:\n  - pattern: \"^org.apache.activemq.artemis<broker=\\\"([^\\\"]*)\\\"><>([^:]*):\\\\s(.*)\"\n    attrNameSnakeCase: true\n    name: just_for_test_$2\n    type: COUNTER\n"
  },
  {
    "path": "test/assets/goss.yaml",
    "content": "\n{{if (.Vars.flags.testmerge) }}\ncommand:\n  xmlstarlet sel -N activemq=\"urn:activemq\" -N core=\"urn:activemq:core\" -t -v \"activemq:configuration/core:core/core:security-enabled\" /var/lib/artemis/etc/broker.xml:\n    exit-status: 0\n    stdout:\n    - false\n    stderr: []\n    timeout: 1000\n{{end}}\n\ncommand:\n  ps -ef|grep -v grep|grep java:\n    exit-status: 0\n    stdout:\n{{if getEnv \"BROKER_CONFIG_GLOBAL_MAX_SIZE\" }}\n    - \"-Dbrokerconfig.globalMaxSize={{ .Env.BROKER_CONFIG_GLOBAL_MAX_SIZE }}\"\n{{end}}\n{{if getEnv \"JAVA_OPTS\" }}\n    - {{ .Env.JAVA_OPTS }}\n{{end}}\n    stderr: []\n    timeout: 1000\n\nport:\n  tcp:8161:\n    listening: true\n{{if getEnv \"ENABLE_JMX_EXPORTER\" }}\n  tcp:9404:\n    listening: true\n{{end}}\n\n{{if and (.Env.ACTIVEMQ_ARTEMIS_VERSION | regexMatch \"(2\\\\.[3-9]\\\\.[0-9]|2\\\\.\\\\d{2}\\\\.[0-9]|[3-9]\\\\d*\\\\.\\\\d+\\\\.[0-9])\") (getEnv \"ARTEMIS_USERNAME\") }}\nhttp:\n  http://127.0.0.1:8161/console:\n    status: 200\n  http://127.0.0.1:8161/console/jolokia:\n    status: 200\n    username: \"{{ .Env.ARTEMIS_USERNAME }}\"\n    password: \"{{ .Env.ARTEMIS_PASSWORD }}\"\n{{end}}\n\nuser:\n  artemis:\n    exists: true\n    uid: 1000\n    groups:\n      - artemis\n\ngroup:\n  artemis:\n    exists: true\n    gid: 1000\n\nprocess:\n  java:\n    running: true\n\nfile:\n  /opt/apache-artemis:\n    exists: true\n    owner: root\n    group: root\n    filetype: symlink\n    linked-to: /opt/apache-artemis-{{ .Env.ACTIVEMQ_ARTEMIS_VERSION }}\n  \n  /opt/apache-artemis-{{ .Env.ACTIVEMQ_ARTEMIS_VERSION }}:\n    exists: true\n    owner: root\n    group: root\n    filetype: directory\n\n  /var/lib/artemis:\n    exists: true\n    owner: artemis\n    group: artemis\n    filetype: directory\n  \n  /var/lib/artemis/data:\n    exists: true\n    owner: artemis\n    group: artemis\n    filetype: directory\n\n  /var/lib/artemis/etc/broker.xml:\n    exists: true\n    owner: artemis\n    group: artemis\n    filetype: file\n    contains:\n{{ if (.Env.ACTIVEMQ_ARTEMIS_VERSION | regexMatch \"(1\\\\.[^0-2]\\\\.[0-9]+|2\\\\.[0-9]+\\\\.[0-9]+)\") }}\n      - <name>{{.Vars.hostname}}</name>\n  {{if getEnv \"DISABLE_SECURITY\" }}\n      - <security-enabled>false</security-enabled>\n  {{end}}\n{{ end }}\n{{ if (.Env.ACTIVEMQ_ARTEMIS_VERSION | regexMatch \"(2\\\\.[3-9]\\\\.\\\\d+|2\\\\.\\\\d{2}\\\\.\\\\d+)\") }}\n  {{if getEnv \"CRITICAL_ANALYZER\" }}\n      - <critical-analyzer>{{.Env.CRITICAL_ANALYZER }}</critical-analyzer>\n  {{end}}\n  {{if getEnv \"CRITICAL_ANALYZER_TIMEOUT\" }}\n      - <critical-analyzer-timeout>{{.Env.CRITICAL_ANALYZER_TIMEOUT }}</critical-analyzer-timeout>\n  {{end}}\n  {{if getEnv \"CRITICAL_ANALYZER_CHECK_PERIOD\" }}\n      - <critical-analyzer-check-period>{{.Env.CRITICAL_ANALYZER_CHECK_PERIOD }}</critical-analyzer-check-period>\n  {{end}}\n  {{if getEnv \"CRITICAL_ANALYZER_POLICY\" }}\n      - <critical-analyzer-policy>{{.Env.CRITICAL_ANALYZER_POLICY }}</critical-analyzer-policy>\n  {{end}}\n{{ end }}\n\n\n\n  /var/lib/artemis/etc/artemis-users.properties:\n    exists: true\n    owner: artemis\n    group: artemis\n    filetype: file\n\n  /var/lib/artemis/etc/artemis-roles.properties:\n    exists: true\n    owner: artemis\n    group: artemis\n    filetype: file\n  \n{{ if and (.Env.ACTIVEMQ_ARTEMIS_VERSION | regexMatch \"(1.5.[^012]|[^1]\\\\.\\\\d+\\\\.\\\\d+)\") (getEnv \"ARTEMIS_PERF_JOURNAL\" \"AUTO\" | regexMatch \"AUTO\") }}\n  /var/lib/artemis/data/.perf-journal-completed:\n    exists: true\n    owner: artemis\n    group: artemis\n    filetype: file\n{{ end }}\n\n  /var/lib/artemis/etc/artemis.profile:\n    exists: true\n    owner: artemis\n    group: artemis\n    filetype: file\n    contains:\n      - \"-Djava.net.preferIPv4Addresses=true\"\n      - \"-XX:+UnlockExperimentalVMOptions\"\n      - \"-XX:+UseCGroupMemoryLimitForHeap\"\n      - \"-XX:MaxRAMFraction=2\"\n{{if getEnv \"JAVA_OPTS\" }}\n      - \"-Djavax.net.ssl.keyStore=/var/lib/artemis/etc/keystore.jks\"\n      - \"-Djavax.net.ssl.keyStorePassword=changeit\"\n{{end}}\n{{if getEnv \"ENABLE_JMX_EXPORTER\" }}\n      - \"jmx_prometheus_javaagent.jar=9404\"\n{{else}}\n      - \"!jmx_prometheus_javaagent.jar\"  \n{{end}} \n      - \"$BROKER_CONFIGS\"\n{{ if or (getEnv \"ARTEMIS_MIN_MEMORY\") (getEnv \"ARTEMIS_MAX_MEMORY\") (getEnv \"ENABLE_JMX\") }}\n  {{if getEnv \"ARTEMIS_MIN_MEMORY\" }}\n      - \"-Xms{{ .Env.ARTEMIS_MIN_MEMORY }}\"\n  {{else}}\n      - \"!-Xms\"  \n  {{end}}\n  {{if getEnv \"ARTEMIS_MAX_MEMORY\" }}\n      - \"-Xmx{{ .Env.ARTEMIS_MAX_MEMORY }}\"\n  {{ else }}\n      - \"!-Xmx\"\n  {{end}}\n  {{if getEnv \"ENABLE_JMX\" }}\n      - \"-Dcom.sun.management.jmxremote=true\"\n      {{ if getEnv \"JMX_PORT\" }}\n      - \"-Dcom.sun.management.jmxremote.port={{ .Env.JMX_PORT }}\"\n      {{ end }}\n      {{ if getEnv \"JMX_PORT\" }}\n      - \"-Dcom.sun.management.jmxremote.rmi.port={{ .Env.JMX_RMI_PORT }}\"\n      {{ end }}\n      - \"-Dcom.sun.management.jmxremote.ssl=false\"\n      - \"-Dcom.sun.management.jmxremote.authenticate=false\"\n  {{end}}\n{{end}}\n\n{{if (.Vars.flags.testmerge) }}\n  /var/lib/artemis/etc/created_by_entrypoint-00:\n    exists: true\n    owner: artemis\n    group: artemis\n{{end}}\n\n{{if and (getEnv \"ENABLE_JMX_EXPORTER\") (getEnv \"TEST_CUSTOM_JMX_EXPORTER_CONFIG\") }}\n  /opt/jmx-exporter/etc/jmx-exporter-config.yaml:\n    exists: true\n    owner: artemis\n    group: artemis\n    contains:\n      - \"just_for_test\"\n{{end}}\n"
  },
  {
    "path": "test/assets/goss_wait.yaml",
    "content": "\nport:\n  tcp:8161:\n    listening: true\n"
  },
  {
    "path": "test/assets/vars-etc-override.yaml",
    "content": "\nflags:\n  testmerge: true\n\nhostname: testHostName.local\n"
  },
  {
    "path": "test/assets/vars.yaml",
    "content": "\nflags:\n  testmerge: false\n\nhostname: testHostName.local"
  },
  {
    "path": "test/test-dockerfile.bats",
    "content": "#!/usr/bin/env bats\n\n@test \"docker file must pass lint\" {\n\tcd src && docker run --rm -i hadolint/hadolint < ${DOCKER_FILE}\n}\n"
  },
  {
    "path": "test/test-entrypoint.bats",
    "content": "#!/usr/bin/env bats\n\n@test \"docker-entrypoint.sh must be a valid posix script\" {\n  shellcheck src/assets/docker-entrypoint.sh\n}\n"
  },
  {
    "path": "test/test-image.bats",
    "content": "#!/usr/bin/env bats\n\n@test \"docker container can run with no arguments\" {\n  \tGOSS_FILES_PATH=$BATS_TEST_DIRNAME/assets GOSS_VARS=\"vars.yaml\" dgoss run -it --rm -h testHostName.local ${COORDINATES}\n}\n\n@test \"docker container can have JSON output\" {\n\n\t# Only 2.10 and later supported\n  \tif $(echo \"${ACTIVEMQ_ARTEMIS_VERSION}\" | grep -Eq \"1\\.[0-9]+\\.[0-9]+|2\\.[0-9]{1}.[0-9]+\"); then\n\t\tskip\n\t\treturn\n\tfi\n\n\texport UUID=\"$(uuidgen)\"\n\t\n\tdocker run -d --name \"$UUID\" -h testHostName.local -e LOG_FORMATTER=JSON ${COORDINATES}\n    \n\tn=0; until [ \"$n\" -ge 5 ]\n   \tdo\n        sleep 2\n       \t[ \"$(docker logs --tail 1 $UUID | jq -r '.hostName')\" = \"testhostname.local\" ] && break\n       \tn=$((n+1))\n   \tdone\n    \n\tdocker stop \"$UUID\"\n   \t[ $n -lt 5 ]\n}\n\n@test \"docker container can set username and password\" {\n\tGOSS_FILES_PATH=$BATS_TEST_DIRNAME/assets GOSS_VARS=\"vars.yaml\" dgoss run -it --rm -h testHostName.local -e ARTEMIS_USERNAME=myusername -e ARTEMIS_PASSWORD=mypassword ${COORDINATES}\n}\n\n@test \"docker container can set java opts\" {\n\tGOSS_FILES_PATH=$BATS_TEST_DIRNAME/assets GOSS_VARS=\"vars.yaml\" dgoss run -it --rm -h testHostName.local -e \"JAVA_OPTS=-Djavax.net.ssl.keyStore=/var/lib/artemis/etc/keystore.jks -Djavax.net.ssl.keyStorePassword=changeit\" ${COORDINATES}\n}\n\n@test \"docker container can autorun performance journal tuning\" {\n\tGOSS_FILES_PATH=$BATS_TEST_DIRNAME/assets GOSS_VARS=\"vars.yaml\" dgoss run -it --rm -h testHostName.local -e ARTEMIS_PERF_JOURNAL=AUTO ${COORDINATES}\n}\n\n@test \"docker container can skip performance journal tuning\" {\n\tGOSS_FILES_PATH=$BATS_TEST_DIRNAME/assets GOSS_VARS=\"vars.yaml\" dgoss run -it --rm -h testHostName.local -e ARTEMIS_PERF_JOURNAL=NEVER ${COORDINATES}\n}\n\n@test \"docker container can enable JMX\" {\n  \tGOSS_FILES_PATH=$BATS_TEST_DIRNAME/assets GOSS_VARS=\"vars.yaml\" dgoss run -it --rm -h testHostName.local -e ENABLE_JMX=true -e JMX_PORT=2222 -e JMX_RMI_PORT=3333 -e BROKER_CONFIG_GLOBAL_MAX_SIZE=9500 ${COORDINATES}\n}\n\n@test \"docker container can enable JMX exporter\" {\n\tGOSS_FILES_PATH=$BATS_TEST_DIRNAME/assets GOSS_VARS=\"vars.yaml\" dgoss run -it --rm -h testHostName.local -e ENABLE_JMX_EXPORTER=true ${COORDINATES}\n}\n\n@test \"docker container can enable JMX exporter with custom config\" {\n\tGOSS_FILES_PATH=$BATS_TEST_DIRNAME/assets GOSS_VARS=\"vars.yaml\" dgoss run -it --rm -h testHostName.local -e ENABLE_JMX_EXPORTER=true -e TEST_CUSTOM_JMX_EXPORTER_CONFIG=true -v $BATS_TEST_DIRNAME/assets/etc-override:/opt/jmx-exporter/etc-override ${COORDINATES}\n}\n\n@test \"docker container can set critical analyzer\" {\n\tGOSS_FILES_PATH=$BATS_TEST_DIRNAME/assets GOSS_VARS=\"vars.yaml\" dgoss run -it --rm -h testHostName.local -e CRITICAL_ANALYZER=false -e CRITICAL_ANALYZER_TIMEOUT=123 -e CRITICAL_ANALYZER_CHECK_PERIOD=456 -e CRITICAL_ANALYZER_POLICY=LOG ${COORDINATES}\n}\n\n@test \"docker container can set memory limits\" {\n\tGOSS_FILES_PATH=$BATS_TEST_DIRNAME/assets GOSS_VARS=\"vars.yaml\" dgoss run -it --rm -h testHostName.local -e ARTEMIS_MIN_MEMORY=1512M -e ARTEMIS_MAX_MEMORY=3048M ${COORDINATES}\n}\n\n@test \"docker container can disable security\" {\n\tGOSS_FILES_PATH=$BATS_TEST_DIRNAME/assets GOSS_VARS=\"vars.yaml\" dgoss run -it --rm -h testHostName.local -e DISABLE_SECURITY=true ${COORDINATES}\n}\n\n@test \"docker container can override etc\" {\n  \tMAYOR=$(echo \"${TAG}\" | cut -d \".\" -f 1)\n\tGOSS_FILES_PATH=$BATS_TEST_DIRNAME/assets GOSS_VARS=\"vars-etc-override.yaml\" dgoss run -it --rm -h testHostName.local -v $BATS_TEST_DIRNAME/assets/$MAYOR.x.x/etc-override:/var/lib/artemis/etc-override ${COORDINATES}\n}\n\n@test \"docker container can replace etc\" {\n\t# Seems like Docker plays well with the Apple's filesystem sandbox guidelines but mktemp doesn't?\n\t# Using mkdir instead of mktemp\n\t# see: https://stackoverflow.com/questions/45122459/docker-mounts-denied-the-paths-are-not-shared-from-os-x-and-are-not-known\n  \tTMP_DIR=$(mkdir -p tmp)\n\tGOSS_FILES_PATH=$BATS_TEST_DIRNAME/assets GOSS_VARS=\"vars.yaml\" dgoss run -it --rm -h testHostName.local -v \"${TMP_DIR}:/var/lib/artemis/etc\" -e RESTORE_CONFIGURATION=true ${COORDINATES}\n\trm -Rf \"${TMP_DIR}\"\n}\n\n"
  }
]