Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web Console is not reachable by default From Container #4

Closed
MMirabito opened this issue Apr 13, 2021 · 4 comments
Closed

Web Console is not reachable by default From Container #4

MMirabito opened this issue Apr 13, 2021 · 4 comments

Comments

@MMirabito
Copy link

MMirabito commented Apr 13, 2021

@tholu I am trying out your docker image as a "sandbox " for my development machine and I read the following:

Since 5.16.0 the Web Console is not reachable by default, as it only listens to 127.0.0.1 inside the container. See AMQ-8018 for more details.

Is the expectation that users of the image would manually implement what AMQ-8018 is saying.

Have you considered this approach (Editing files from dockerfile). By Adding the following line after your RUN command in the Dockerfile I was able to access the console via the browser.

RUN sed -i "s|127.0.0.1|0.0.0.0|g" $ACTIVEMQ_HOME/conf/jetty.xml

I would be interested to know your take on this workaround for a "development" environment

Thanks in advance,
max

@tholu
Copy link
Contributor

tholu commented Apr 14, 2021

@MMirabito Thanks for your feedback!

We're currently using it with a docker-compose.yml like this:

version: '2.1'
services:
  activemq:
    image: symptoma/activemq:5.16.1
    restart: unless-stopped
    volumes:
      - amqdata:/opt/activemq/data
      - ./conf/jetty.xml:/opt/activemq/conf/jetty.xml
      - ./conf/activemq.xml:/opt/activemq/conf/activemq.xml
      - ./conf/credentials.properties:/opt/activemq/conf/credentials.properties
      - ./conf/jetty-realm.properties:/opt/activemq/conf/jetty-realm.properties
    network_mode: bridge
    ports:
      - "127.0.0.1:8161:8161"   # Web Console
      - "127.0.0.1:1883:1883"   # MQTT
      - "127.0.0.1:5672:5672"   # AMQP
      - "127.0.0.1:61613:61613" # STOMP
      - "127.0.0.1:61614:61614" # WS
      - "127.0.0.1:61616:61616" # JMS
    mem_limit: 512m

volumes:
  amqdata:
    driver: local

This way, we overwrite /conf/jetty.xml with a version that listens on 0.0.0.0. Let me know if you need more help here.

@tholu tholu closed this as completed Apr 14, 2021
@MMirabito
Copy link
Author

MMirabito commented Apr 14, 2021

@tholu, thanks so much for the the YML file really cool. Unfortunately it's not working on my Win 10 environment. I get the following message when I do docker-compose up.

caused: not a directory: unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type

Maybe it's a win 10 quirk I tried to resolve it but not successful so far. I noticed that the conf directory is created then the jetty.xml and all other files are not present but rather have become directories instead, see screenshot. I am running Docker 20.10.5 I believe it is the latest for windows.

image

Thanks again,
max

`D:\Docker-Data\Apache-Active-MQ>docker-compose up
Removing apache-active-mq_activemq_1
Recreating 85964950b619_apache-active-mq_activemq_1 ... error

ERROR: for 85964950b619_apache-active-mq_activemq_1 Cannot start service activemq: OCI runtime create failed: container_linux.go:370: starting container process caused: process_linux.go:459: container init caused: rootfs_linux.go:59: mounting "/run/desktop/mnt/host/d/Docker-Data/Apache-Active-MQ/conf/jetty.xml" to rootfs at "/var/lib/docker/overlay2/e3e618db4b7f36d54bff47bdb3436bab128960f2f5b7ac153f93d284e61d1a8d/merged/opt/apache-activemq-5.16.1/conf/jetty.xml" caused: not a directory: unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type

ERROR: for activemq Cannot start service activemq: OCI runtime create failed: container_linux.go:370: starting container process caused: process_linux.go:459: container init caused: rootfs_linux.go:59: mounting "/run/desktop/mnt/host/d/Docker-Data/Apache-Active-MQ/conf/jetty.xml" to rootfs at "/var/lib/docker/overlay2/e3e618db4b7f36d54bff47bdb3436bab128960f2f5b7ac153f93d284e61d1a8d/merged/opt/apache-activemq-5.16.1/conf/jetty.xml" caused: not a directory: unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type
ERROR: Encountered errors while bringing up the project.`

@tholu
Copy link
Contributor

tholu commented Apr 14, 2021

@MMirabito You have to create a /conf subdirectory together with the docker-compose.yml file and put all the mapped files there. For starters, you can use files distributed with ActiveMQ (and adjust the port in jetty.xml accordingly).

@MMirabito
Copy link
Author

MMirabito commented Apr 14, 2021

@tholu, thanks for clarifying it, I really feel clueless for some reason I was convinced that i would use the files from the docker container.

It's working now thank again.

max

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants