1、查询activemq

docker search activemq

[root@iz2zei0x4t16rv0e5buzvhz tmp]# docker search activemq
NAME                                     DESCRIPTION                                     STARS               OFFICIAL            AUTOMATED
webcenter/activemq                       ActiveMQ 5.14.3 with OpenJDK-jre-8-headless …   157                                     [OK]
rmohr/activemq                           Various versions of ActiveMQ neatly packet i…   59                                      [OK]
vromero/activemq-artemis                 ActiveMQ Artemis image (Debian and Alpine ba…   16                                      [OK]
cloudesire/activemq                      Latest activemq                                 3                                       [OK]
andreptb/activemq                        Debian Jessie based image with ActiveMQ inst…   3                                       [OK]
elsammons/centos-activemq-artemis        Will create a centos image running Apache Ac…   3                                       [OK]
aterreno/activemq-dockerfile                                                             3                                       [OK]
kdomanski/activemq                       Apache ActiveMQ                                 2                                       [OK]        

webcenter/activemq 是使用人最多。

2、安装 activeMq

关键命令:

docker run -d --name activemq2 \
-p 61616:61616 \
-p 8161:8161 \
webcenter/activemq

61617 可以/设置为activemq默认端口号 61616,8162 也一样可以设置。

执行命令如下:

[root@iz2zei0x4t16rv0e5buzvhz tmp]# docker run -d --name myactivemq \
> -p 61617:61616 \
> -p 8162:8161 \
> webcenter/activemq
Unable to find image 'webcenter/activemq:latest' locally
latest: Pulling from webcenter/activemq
7dcf5a444392: Pull complete 
9eebba75a87f: Pull complete 
1f0440d87cc7: Pull complete 
dacd0555c1b4: Pull complete 
b0f19aa05a94: Pull complete 
4796f64423b2: Pull complete 
5d994b710cb9: Pull complete 
313a84c05d3c: Pull complete 
1d6a562461f1: Pull complete 
e25558998b21: Pull complete 
1423ae5a1b0b: Pull complete 
8d4e082d1ca6: Pull complete 
098d68aaa4ae: Pull complete 
Digest: sha256:35015988c4047a2ab1888466f5aae30420f7addde4c467e5db9ae64eea6b47b0
Status: Downloaded newer image for webcenter/activemq:latest
21cb0f05ede029bb1d2437bc5d8fe2f45417274fb5d72d1f0548be820151e8b7

[root@iz2zei0x4t16rv0e5buzvhz tmp]# docker ps 
CONTAINER ID        IMAGE                COMMAND                  CREATED             STATUS              PORTS                                                                                   NAMES
21cb0f05ede0        webcenter/activemq   "/app/run.sh"            7 seconds ago       Up 5 seconds        1883/tcp, 5672/tcp, 61613-61614/tcp, 0.0.0.0:8162->8161/tcp, 0.0.0.0:61617->61616/tcp   myactivemq
fa3706ed30c4        redis                "docker-entrypoint.s…"   About an hour ago   Up About an hour    0.0.0.0:6379->6379/tcp                                                                  myredis
7677a2b9eaa7        tomcat:8.0           "catalina.sh run"        16 hours ago        Up 2 hours          0.0.0.0:8080->8080/tcp                                                                  xenodochial_goldwasser
84694b113c10        mysql:5.7            "docker-entrypoint.s…"   38 hours ago        Up 2 hours          0.0.0.0:3306->3306/tcp, 33060/tcp                                                       mysql
[root@iz2zei0x4t16rv0e5buzvhz tmp]# 

3、设置防水墙

因为使用的是阿里云轻应用服务器,所以每添加一个应用,都要添加端口号。

在这里插入图片描述

4、访问后台admin界面

http://XXXXX:8161/admin/topics.jsp

在这里插入图片描述

Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐