1.docker搭建单体activemq
#查询镜像
docker search activemq
#取start最多的镜像
docker pull docker.io/webcenter/activemq
#启动镜像容器
docker run -d --name activemq -p 61616:61616 -p 8161:8161 --restart=always docker.io/webcenter/activemq:latest
#访问web页面
http://宿主机IP:8161 #默认账号:admin 默认密码:admin
#进入容器内部
docker exec -it activemq /bin/bash
#修改authenticate为true 高版本已经默认为true
vi /opt/activemq/conf/jetty.xml
#增加账号
vi /opt/activemq/conf/jetty-realm.properties
#增加插件
vi /opt/activemq/conf/activemq.xml
#增加如下配置
<plugins>
<simpleAuthenticationPlugin>
<users>
<authenticationUser username="${activemq.username}" password="${activemq.password}" groups="users,admins"/>
</users>
</simpleAuthenticationPlugin>
</plugins>
#修改credentials.properties
vi /opt/activemq/conf/credentials.properties
#若设置错误,可用docker cp命令覆盖已修改的文件
docker cp jetty.xml activemq:/opt/activemq/conf/jetty.xml