'Set user and password for rabbitmq on docker container

I am trying to create a rabbitmq docker container with default user and password but when I try to enter to the management plugin those credentials doesn't work

This is how I create the container:

docker run -d -P --hostname rabbit -p 5009:5672 -p 5010:15672 --name rabbitmq -e RABBITMQ_DEFAULT_USER=user -e RABBITMQ_DEFAULT_PASS=pass -v /home/desarrollo/rabbitmq/data:/var/lib/rabbitmq rabbitmq:3.6.10-management

What am I doing wrong?,

Thanks in advance



Solution 1:[1]

The default user is created only if the database does not exist. Therefore the environment variables have no effect if the volume already exists.

Solution 2:[2]

I had the same problem when trying to access in Chrome. Firefox worked fine. The culprit turned out to be a deprecated JS method that was no longer allowed by Chrome.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 drizzd
Solution 2 Eddie Prislac