0
votes

I have create a activemq docker file and when i start the image i cannot log to the login screen. The url is http://127.0.0.1:8161

here is my docker file you can also see the url in the log.

    # Using jdk as base image
    FROM openjdk:8-jdk-alpine
    
    # Copy the whole directory of activemq into the image
    COPY activemq /opt/activemq
    
    # Set the working directory to the bin folder 
    WORKDIR /opt/activemq/bin
    
    # Start up the activemq server
    ENTRYPOINT ["./activemq","console"]
and here is the log from the console 


INFO: Using java '/usr/lib/jvm/java-1.8-openjdk/bin/java'
INFO: Starting in foreground, this is just for debugging purposes (stop process by pressing CTRL+C)
INFO: Creating pidfile /opt/activemq//data/activemq.pid
Java Runtime: IcedTea 1.8.0_212 /usr/lib/jvm/java-1.8-openjdk/jre
  Heap sizes: current=390656k  free=386580k  max=5779968k
    JVM args: -Djava.util.logging.config.file=logging.properties - 
Djava.security.auth.login.config=/opt/activemq//conf/login.config -Djava.awt.headless=true - 
Djava.io.tmpdir=/opt/activemq//tmp -Dactivemq.classpath=/opt/activemq//conf:/opt/activemq//../lib/: - 
Dactivemq.home=/opt/activemq/ -Dactivemq.base=/opt/activemq/ -Dactivemq.conf=/opt/activemq//conf - 
Dactivemq.data=/opt/activemq//data
Extensions classpath:
  
 
 
 
 [/opt/activemq/lib,/opt/activemq/lib/camel,/opt/activemq/lib/optional,/opt/activemq/lib/web,
 /opt/activemq 
 /lib/extra]
 ACTIVEMQ_HOME: /opt/activemq
 ACTIVEMQ_BASE: /opt/activemq
 ACTIVEMQ_CONF: /opt/activemq/conf
 ACTIVEMQ_DATA: /opt/activemq/data
 Loading message broker from: xbean:activemq.xml
 INFO | Refreshing org.apache.activemq.xbean.XBeanBrokerFactory$1@6be46e8f: startup date [Mon Nov 23 
 15:32:26 GMT 2020]; root of context hierarchy
 INFO | Using Persistence Adapter: KahaDBPersistenceAdapter[/opt/activemq/data/kahadb]
 INFO | KahaDB is version 7
 INFO | PListStore:[/opt/activemq/data/localhost/tmp_storage] started
 INFO | Apache ActiveMQ 5.16.0 (localhost, ID:afee6bfb43ba-45805-1606145547047-0:1) is starting
 INFO | Listening for connections at: tcp://afee6bfb43ba:61616? 
 maximumConnections=1000&wireFormat.maxFrameSize=104857600
 INFO | Connector openwire started
 INFO | Listening for connections at: amqp://afee6bfb43ba:5672? 
 maximumConnections=1000&wireFormat.maxFrameSize=104857600
 INFO | Connector amqp started
 INFO | Listening for connections at: stomp://afee6bfb43ba:61613? 
 maximumConnections=1000&wireFormat.maxFrameSize=104857600
 INFO | Connector stomp started
 INFO | Listening for connections at: mqtt://afee6bfb43ba:1883? 
 maximumConnections=1000&wireFormat.maxFrameSize=104857600
 INFO | Connector mqtt started
 INFO | Starting Jetty server
 INFO | Creating Jetty connector
 WARN | [email protected]@ab7395e{/,null,STARTING} has uncovered http 
 methods for path: /
 INFO | Listening for connections at ws://afee6bfb43ba:61614? 
 maximumConnections=1000&wireFormat.maxFrameSize=104857600
 INFO | Connector ws started
 INFO | Apache ActiveMQ 5.16.0 (localhost, ID:afee6bfb43ba-45805-1606145547047-0:1) started
 INFO | For help or more information please see: http://activemq.apache.org
 INFO | ActiveMQ WebConsole available at http://127.0.0.1:8161/
 INFO | ActiveMQ Jolokia REST API available at http://127.0.0.1:8161/api/jolokia/

what have i done wrong ? Thanks

1
How do you run your docker image? - Andrei Stoicescu
@AndreiStoicescu docker run --publish 8161:8161 --detach --name bb activemq_custom:1.0 - JohnF Conor
And what does it show when you try to access that url? - Andrei Stoicescu
@AndreiStoicescu nothing. I think it cannot find the url of docker I am not sure .Also If i use developer tools (network) i dont see anything. - JohnF Conor
try to run it with docker run --publish 0.0.0.0:8161:8161 --detach --name bb activemq_custom:1.0 and see if you can connect to 0.0.0.0:8161 or localhost:8161. Also can you add the output to docker ps -a - Andrei Stoicescu

1 Answers

0
votes

As at ActiveMQ 5.16.0 the jetty endpoint host value was changed from 0.0.0.0 to 127.0.0.1, see AMQ-7007.

To overcome this in my Dockerfile I use CMD ["/bin/sh", "-c", "bin/activemq console -Djetty.host=0.0.0.0"]