根据https://github.com/apache/activemq-artemis/tree/main/artemis-docker文档可以进行安装

下载Docker对应配置文件

https://github.com/apache/activemq-artemis/tree/main/artemis-docker

将下面的文件下载到本地 (本次是基于jdk进行镜像的生成,因此只需要下载Dockerfile-adoptopenjdk-11即可)

* Dockerfile-adoptopenjdk-11
* docker-run.sh
* prepare-docker.sh

使用上面的脚本执行下面的命令

# 从服务器上拉取2.19.0版本artemis
sh prepare-docker.sh --from-release --artemis-version 2.19.0

构建镜像

# 进入下载的artemis目录
cd _TMP_/artemis/2.19.0
# 构建镜像
docker build -f ./docker/Dockerfile-adoptopenjdk-8 -t artemis-adoptopenjdk-8 .

启动容器

docker run --rm -it -p 61616:61616 -p 8161:8161 artemis-adoptopenjdk-8

下载文件中是以jdk11为原始镜像处理的,这里改成了jdk1.8

prepare-docker.sh

该文件无无需处理,如果提示tree命令找不到时,可以使用brew install tree进行安装

#!/bin/sh
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
#
#   http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied.  See the License for the
# specific language governing permissions and limitations
# under the License.# Setting the script to fail if anything goes wrong
set -e#This is a script to Prepare an artemis folder to generate the Release.usage () {cat <<HERE$@Usage:# Prepare for build the Docker Image from the local distribution./prepare-docker.sh --from-local-dist --local-dist-path {local-distribution-directory}# Prepare for build the Docker Image from the release version./prepare-docker.sh --from-release --artemis-version {release-version}# Show the usage command./prepare-docker.sh --helpExample:./prepare-docker.sh --from-local-dist --local-dist-path ../artemis-distribution/target/apache-artemis-2.17.0-SNAPSHOT-bin/apache-artemis-2.17.0-SNAPSHOT./prepare-docker.sh --from-release --artemis-version 2.16.0  HEREexit 1
}next_step () {cat <<HEREWell done! Now you can continue with the Docker image build.
Building the Docker Image:Go to $ARTEMIS_DIST where you prepared the binary with Docker files.# Go to $ARTEMIS_DIST$ cd $ARTEMIS_DIST# For Debian$ docker build -f ./docker/Dockerfile-debian -t artemis-debian .# For CentOS$ docker build -f ./docker/Dockerfile-centos -t artemis-centos .# For AdoptOpen JDK 11$ docker build -f ./docker/Dockerfile-adoptopenjdk-11 -t artemis-adoptopenjdk-11 .# For AdoptOpen JDK 11 (Build for linux ARMv7/ARM64)$ docker buildx build --platform linux/arm64,linux/arm/v7 --push -t {your-repository}/apache-artemis:2.17.0-SNAPSHOT -f ./docker/Dockerfile-adoptopenjdk-11 .Note: -t artemis-debian, -t artemis-centos and artemis-adoptopenjdk-11 are just
tag names for the purpose of this guideFor more info read the readme.mdHEREexit 1
}while [ "$#" -ge 1 ]
do
key="$1"case $key in--help)usage;;--from-local-dist)FROM_LOCAL="true";;--from-release)FROM_RELEASE="true";;--local-dist-path)LOCAL_DIST_PATH="$2"shift;;--artemis-version)ARTEMIS_VERSION="$2"shift;;*)# unknown optionusage "Unknown option";;esacshift
done# TMPDIR must be contained within the working directory so it is part of the
# Docker context. (i.e. it can't be mktemp'd in /tmp)
BASE_TMPDIR="_TMP_/artemis"echo $BASE_TMPDIR
echo ${BASE_TMPDIR}/${ARTEMIS_VERSION}cleanup() {if [ -d "${BASE_TMPDIR}/${ARTEMIS_VERSION}" ]thenecho "Clean up the ${BASE_TMPDIR}/${ARTEMIS_VERSION} directory"find "${BASE_TMPDIR}" -name "${ARTEMIS_VERSION}" -type d -mmin +60 -exec rm -rf "{}" \;elsemkdir -p "${BASE_TMPDIR}/${ARTEMIS_VERSION}"fi
}if [ -n "${FROM_RELEASE}" ]; then[ -n "${ARTEMIS_VERSION}" ] || usage "You must specify the release version (es.: --artemis-version 2.16.0)"cleanupARTEMIS_BASE_URL="$(curl -s https://www.apache.org/dyn/closer.cgi\?preferred=true)activemq/activemq-artemis/${ARTEMIS_VERSION}/"ARTEMIS_DIST_FILE_NAME="apache-artemis-${ARTEMIS_VERSION}-bin.tar.gz"CURL_OUTPUT="${BASE_TMPDIR}/${ARTEMIS_VERSION}/${ARTEMIS_DIST_FILE_NAME}"if [ -z "$(ls -A ${BASE_TMPDIR}/${ARTEMIS_VERSION})" ]thenecho "Downloading ${ARTEMIS_DIST_FILE_NAME} from ${ARTEMIS_BASE_URL}..."curl --progress-bar "${ARTEMIS_BASE_URL}${ARTEMIS_DIST_FILE_NAME}" --output "${CURL_OUTPUT}"echo "Expanding ${BASE_TMPDIR}/${ARTEMIS_VERSION}/${ARTEMIS_DIST_FILE_NAME}..."tar xzf "$CURL_OUTPUT" --directory "${BASE_TMPDIR}/${ARTEMIS_VERSION}" --strip 1echo "Removing ${BASE_TMPDIR}/${ARTEMIS_VERSION}/${ARTEMIS_DIST_FILE_NAME}..."rm -rf "${BASE_TMPDIR}/${ARTEMIS_VERSION}"/"${ARTEMIS_DIST_FILE_NAME}"fiARTEMIS_DIST="${BASE_TMPDIR}/${ARTEMIS_VERSION}"echo "Using Artemis dist: ${ARTEMIS_DIST}"elif [ -n "${FROM_LOCAL}" ]; thenif [ -n "${LOCAL_DIST_PATH}" ]; thenARTEMIS_DIST=${LOCAL_DIST_PATH}echo "Using Artemis dist: ${ARTEMIS_DIST}"else usage "You must specify the local distribution directory"fiecho "-----------------------------" if [ ! -d "${ARTEMIS_DIST}" ]thenusage "Directory ${ARTEMIS_DIST} does not exist"fiif [ -d "${ARTEMIS_DIST}/docker" ]thenecho "Clean up the ${ARTEMIS_DIST}/docker directory"rm -rf "${ARTEMIS_DIST}/docker"fielseusagefiif [ ! -d "${ARTEMIS_DIST}/docker" ]
thenmkdir "${ARTEMIS_DIST}/docker"
ficp ./Dockerfile-* "$ARTEMIS_DIST/docker"
cp ./docker-run.sh "$ARTEMIS_DIST/docker"echo "Docker file support files at : $ARTEMIS_DIST/docker"
tree "$ARTEMIS_DIST/docker"next_step

docker-run.sh

#!/bin/bash
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
#
#   http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied.  See the License for the
# specific language governing permissions and limitations
# under the License.# This is the entry point for the docker images.
# This file is executed when docker run is called.set -eBROKER_HOME=/var/lib/
CONFIG_PATH=$BROKER_HOME/etc
export BROKER_HOME OVERRIDE_PATH CONFIG_PATHif [[ ${ANONYMOUS_LOGIN,,} == "true" ]]; thenLOGIN_OPTION="--allow-anonymous"
elseLOGIN_OPTION="--require-login"
fiCREATE_ARGUMENTS="--user ${ARTEMIS_USER} --password ${ARTEMIS_PASSWORD} --silent ${LOGIN_OPTION} ${EXTRA_ARGS}"echo CREATE_ARGUMENTS=${CREATE_ARGUMENTS}if ! [ -f ./etc/broker.xml ]; then/opt/activemq-artemis/bin/artemis create ${CREATE_ARGUMENTS} .
elseecho "broker already created, ignoring creation"
fiexec ./bin/artemis "$@"

Dockerfile-adoptopenjdk-8

# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
#
#   http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied.  See the License for the
# specific language governing permissions and limitations
# under the License.# ActiveMQ ArtemisFROM openjdk:8u312
LABEL maintainer="Apache ActiveMQ Team"
# Make sure pipes are considered to determine success, see: https://github.com/hadolint/hadolint/wiki/DL4006
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
WORKDIR /opt# 账号
ENV ARTEMIS_USER admin
# 密码
ENV ARTEMIS_PASSWORD 123456
# 是否允许匿名登录
ENV ANONYMOUS_LOGIN true
ENV EXTRA_ARGS --http-host 0.0.0.0 --relax-jolokia# add user and group for artemis
RUN groupadd -g 1000 -r admin && useradd -r -u 1000 -g admin admin \&& apt-get -qq -o=Dpkg::Use-Pty=0 update && \apt-get -qq -o=Dpkg::Use-Pty=0 install -y libaio1 && \rm -rf /var/lib/apt/lists/*USER adminADD . /opt/activemq-artemis# Web Server
EXPOSE 8161 \
# JMX Exporter9404 \
# Port for CORE,MQTT,AMQP,HORNETQ,STOMP,OPENWIRE61616 \
# Port for HORNETQ,STOMP5445 \
# Port for AMQP5672 \
# Port for MQTT1883 \
#Port for STOMP61613USER rootRUN mkdir /var/lib/artemis-instance && chown -R admin.admin /var/lib/artemis-instanceCOPY ./docker/docker-run.sh /USER admin# Expose some outstanding folders
VOLUME ["/var/lib/artemis-instance"]
WORKDIR /var/lib/artemis-instanceENTRYPOINT ["/docker-run.sh"]
CMD ["run"]

Mac使用Docker安装artemis相关推荐

  1. macos docker 安装mysql,mac 中docker安装mysql的图文教程

    今天在docker中安装了mysql ,是自己打的docker包. 首先新建dockerfile 内容如下: from mysql:latest 新建dockerfile后执行build命令: 构建镜 ...

  2. Zookeeper:Mac通过Docker安装Zookeeper集群

    此篇为 "Mac通过Docker安装Zookeeper集群",笔者原本计划是接下来更新Zookeeper应用系列的相关内容,但相关内容依赖Zookeeper集群,虽然前面也更新了 ...

  3. Mac 通过docker安装MinIO

    前言 最近MeterSphere出了新版本,新版本架构是这样的(如下图).采用了SpringCloud+SpringBoot 微服务的架构的.跟以往相比,多了一个新的组件,MinIO.也就是分布式存储 ...

  4. Mac通过Docker安装Oracle 11g发布版

    Mac通过Docker安装Oracle 11g发布版 目录 Mac通过Docker安装Oracle 11g发布版 第一步:下载Oracle 第二步:Docker 1.启动docker 2.拉去orac ...

  5. M1 mac 使用docker 安装mysql

    1.在Mac中安装 docker 的mysql 镜像. docker pull mysql/mysql-server docker run --name mysql01 -p 3306:3306 -e ...

  6. Mac下docker安装kali/ubuntu14.04

    0.命令安装 # brew cask install docker1.手动下载安装docker https://store.docker.com/editions/community/docker-c ...

  7. mac 使用docker 安装mysql

    1.在Mac中安装 docker 的mysql 镜像. docker pull mysql/mysql-server docker run --name mysql01 -p 3306:3306 -e ...

  8. mac 使用docker安装oracle

    使用docker安装oracle 由于开发需要,需要配置oracle环境,所以在本地安装oracle进行相关开发测试,使用M1的mac同学请忽视该教程,因为M1使用的ARM架构,和本教程的docker ...

  9. Docker——Mac通过Docker安装Oracle11g

    Mac OS系统如何通过Docker安装Oracle11g Docker基本概念 1.在Mac系统上安转Docker 1.2.在Mac下载Docker 1.3.stable Docker下载 http ...

最新文章

  1. java app上传图片接口_接口app 接口中上传 图片
  2. java list 不包含_java判断list是否包含某个值
  3. 掌握Angular2的服务(service)
  4. 将JSON数据转换成JAVA的实体类
  5. Effective C++ 条款11:在operator=中处理自我赋值
  6. 生产上完成TopN统计流程
  7. day53-Django之路由系统
  8. 华为云大数据存储的冗余方式是三副本_华为TaurusDB技术解读(转载)
  9. 数据库工作笔记009---Centos中导出mysql数据库
  10. 23种设计模式(十八)状态变化之备忘录
  11. sql 替换字段中的部分字符,替换指定字符
  12. 中标麒麟的下载和安装
  13. 【面试指南】如何看待你的竞争对手30k,而你却3k?想要高薪,我们也要学会拧螺丝、造飞机的能力
  14. 【老生谈算法】matlab实现K均值聚类算法——K均值聚类算法
  15. ENVI中对图像监督分类结果的编辑
  16. mfc动态改变clip风格_游戏背景音乐的种类—动态音效
  17. ABAP 去重 delete adjacent duplicates
  18. 博客怎么写出好的文章吸引读者,只有7个基本的写作技巧
  19. 【英语】美式元音 总结
  20. CSDN日报20170302——《一个想法:成立草根技术联盟对开发人员进行技术定级解决企业员工招聘难问题!》

热门文章

  1. 推荐5款Windows桌面效率工具
  2. idea无法安装插件
  3. 2019年京东PLUS会员前端开发之路总结
  4. (13.1.3.10)PMBOK之三:十大知识领域之相关方管理
  5. 【代码复现】知识表示学习MHGRN预处理操作(二)
  6. 【调优方法】——warmup
  7. HDU6194 后缀数组的应用
  8. 【XSY2733】Disembrangle DP
  9. __call__ 的用法
  10. 磁盘管理命令df和du的区别,以及du -sh ./与du -sh ./*区别