I want to run RabbitMQ in a Docker container. So I found this guide which states that all you have to do is run this command:
docker run -d --hostname my-rabbit --name some-rabbit rabbitmq:3-management
And after that, RabbitMQ should be available in your browser on http://container-ip:15672. I'm not entirely sure what "container ip" is, but I assume it's localhost when running it on my own PC. But when I open that, I just get a blank page, with an error in the bottom:
undefined: There is no template at js/tmpl/login.ejs undefined
Now this seems to suggest that maybe there is something wrong with the image. But then I found another post here on StackOverflow in which it is suggested to run the same image (as far as I can see) but with a different command:
docker run -it --rm --name mymq -p 5672:5672 -p 15672:15672 rabbitmq:3-management
If I run this, it works just fine. Can anyone tell me why this is? To me it seems like I'm running the exact same image, just in a slightly different way?
Update:
I found this post where someone had the same error. People seems to have solved it by changing configs or re-installing RabbitMQ. However, that doesn't explain why a newly started container exhibits this behaviour and only when started in a certain manner.
Try another image, I encountered this problem with using the docker image rabbitmq:3, problem solved when I changed to rabbitmq:3.10-management.
See: https://hub.docker.com/_/rabbitmq#:~:text=more%20details.)-,Management%20Plugin,-There%20is%20a
Related
I am trying to follow this tutorial on setting up docker clusters https://levelup.gitconnected.com/setting-up-rabbitmq-cluster-c247d61385ed
I get to running the following command that I will need to run for the other two nodes
docker run -d --rm --net rabbit -v C:\RabbitPrototype\config\rabbit-1/:/config/ -e RABBITMQ_CONFIG_FILE=/config/rabbitmq -e RABBITMQ_ERLANG_COOKIE=ABCDYJLFQNTHDRZEPLOZ --hostname rabbit-1 --name rabbit-1 -p 8081:15672 rabbitmq:3.9-management
I can see it run in the docker graphical container view, but after a couple seconds it disappears, as seems that the container stops running, what do I need to do order to keep it running, are there any logs to look at to see why it stopped?
I have removed the --rm mentioned by #Omer
I get this error
2021-12-16 16:24:41.403174+00:00 [erro] <0.130.0> Failed to load advanced configuration file "/config/rabbitmq.config": 1: syntax error before: '.'
My config file that I am trying to load looks like this, copied from the tutorial page, so currently not sure what the issue is with the . (dot) between then users.guest part on line one?
loopback_users.guest = false
listeners.tcp.default = 5672
cluster_formation.peer_discovery_backend = rabbit_peer_discovery_classic_config
cluster_formation.classic_config.nodes.1 = rabbit#rabbit-1
cluster_formation.classic_config.nodes.2 = rabbit#rabbit-2
cluster_formation.classic_config.nodes.3 = rabbit#rabbit-3
The issue from the error message seems to be that RabbitMQ thinks you are providing it an advanced configuration file instead of the normal configuration file - https://www.rabbitmq.com/configure.html#advanced-config-file . Even though since RabbitMQ 3.7+ has sysctl(the format you used) kind of configuration files, the advanced configuration file still uses the classic configuration format(https://www.rabbitmq.com/configure.html#config-file-formats) which explains the syntax error.
From the docs - https://www.rabbitmq.com/configure.html#configuration-files
Not sure why it would pick the value of the RABBITMQ_CONFIG_FILE as the advanced config file instead of the default one.
Can you update the question with the full logs? Even after the container is dead, you can check its logs using
docker logs rabbit-1
I seem to have something running with this command now running this, I renamed the rabbitmq.config to rabbitmq.conf and also told it to put it in the /etc/rabbitmq/ which seems to be the default location
docker run --net rabbit -v C:\\RabbitPrototype\config\rabbit-1\:/etc/rabbitmq/ -e RABBITMQ_ERLANG_COOKIE=ABCDYJLFQNTHDRZEPLOZ --hostname rabbit-1 --name rabbit-1 -p 8081:15672 rabbitmq:3.9-management
I've been using for years a containerized version of a web-application on my development laptop. Usually I do something like
docker run -it -d --rm -h app.localhost my-app
and, having added app.localhost to my hosts file, going to http://app.localhost everything works. Yesterday an update came for docker and I'm no longer able to do that. Running the image with the same command line options and trying to connect to the application I get a browser error page and checking the logs in the container shows no request at all got to the web server. Running curl http://app.localhost in a terminal works fine, and I've been able to fix the problem changing the my command line options to
docker run -it -d --rm -p 80:80 -h app.localhost my-app
i.e. explicitly exposing port 80.
Can anyone explain what went wrong? And why would curl and my web browser behave differently?
Edit: to clarify: I'm referring to an update of the docker packages for my OS (Ubuntu 18 if that matters).
I was trying to have some fun with Docker and test out CouchDB.
I'm working on a Docker on Windows 10 running on WSL2.
I understood that it was easy enough to run something like:
docker run -d --name my-couchdb -e COUCHDB_USER=admin -e COUCHDB_PASSWORD=password couchdb:latest -p 5984:5984
And actually, it is running "fine."
Fine in the sense that I can see from the logs that it is running ok, with no error.
But at this point, I wanted to set it up, going to http://127.0.0.1:5984/_utils#setup or http://[::1]:5984/_utils#setup
As you can imagine, I cannot access it.
Any idea on how to troubleshoot it?
I'm no expert in docker, and it is the first time on CouchDB, so I wanted to have a quick run, but I'm already stuck.
Thanks,
Ro
As per documentation here https://docs.docker.com/engine/reference/commandline/run/
docker run [OPTIONS] IMAGE [COMMAND] [ARG...]
item you put after the image will be act as arguments which is not what you want here.
I'm trying to launch a GitLab or Gitea docker container in my QNAP NAS (Container Station) and, for some reason, when I restart the container, it won't start back up because files are lost (it seems).
For example, for GitLab it gives me errors saying runsvdir-start and gitlab-ctl don't exist. For Gitea it's the s6-supervise file.
Now I am launching the container like this, just to keep it simple:
docker run -d --privileged --restart always gitea/gitea:latest
A simple docker stop .... and docker start .... breaks it. How do I troubleshoot something like this?
QNAP has sent this issue to R&D and they were able to replicate it. It's a bug and will probably be fixed in a new Container Station update.
It's now fixed in QTS 4.3.6.20190906 and later.
Normal to lose you data if you launch just :
docker run -d --privileged --restart always gitea/gitea:latest
You should use VOLUME to sharing folder between your host and docker host for example :
docker run -d --privileged -v ./gitea:/data -p 3000:3000 -p 222:22 --restart always gitea/gitea:latest
Or use docker-compose.yml (see the official docs).
According to this documentation it is possible to start a private docker hub by executing:
docker run -d -p 5000:5000 --restart=always registry:2
Perhaps something was wrong with the build, so the following was tried as well:
docker run -d -p 5000:5000 --restart=always registry:latest
but the problem persists.
The problem is that navigating to localhost:5000 returns a blank page instead of the UI.
I have reported an issue on Github.
joaofnfernandes commented 9 hours ago
Docker Registry is a backend service and doesn't have any web UI.
You can continue learning about Docker Registry here. If you're
looking for a registry with a management UI, maybe take a look into
Docker Trusted Registry.
I'm closing this issue since it doesn't report anything we can improve
on docs.docker.com. Feel free to open more issues if you find anything
wrong with docs.docker.com 🐳
Docker registry is a background service without UI, they wont be doing something like UI in a short time-span as it isn't their main focus.
If you would like a UI for your Docker registry, then you could use a container containing a full UI.
Demo by running: docker run -d -p 80:80 joxit/docker-registry-ui