0

I am having an error when trying to build image with:

docker-compose build

Error:

Error

docker-compose.yml file:

version: '3'

services:
  rabbitmq:
    container_name: hrabbitmq
    image: hyperloopupv:rabbitmq
    build: './rabbitmq'    
    ports:
    - "5672:5672"
    - "15672:15672"
    hostname: hypernode
    tty: true
    volumes:
      - rabbit1:/var/lib/rabbitmq
      - ./conf/:/etc/rabbitmq/
    command:  bash -c "sleep 10; rabbitmq-server;"
    environment:
      - RABBITMQ_USERNAME=guest
      - RABBITMQ_PASSWORD=guest
      - RABBITMQ_NODE_NAME=rabbit@hypernode

Rabbitmq dockerfile:

FROM rabbitmq:3-management

MAINTAINER victorcf999@gmail.com

# APT update, wget and sudo
RUN apt-get update -y && apt-get upgrade -y
RUN apt-get install apt-utils -y
RUN apt-get install wget -y
RUN apt-get install sudo -y
RUN apt-get install apt-transport-https ca-certificates -y

#Rabbitmq status
RUN rabbitmqctl status

#Set user
RUN rabbitmqctl add_user hyper hyperpass
RUN rabbitmqctl set_user_tags hyper administrator
RUN rabbitmqctl set_permissions -p / hyper ".*" ".*" ".*"

#Eneable management console
RUN rabbitmq-plugins enable rabbitmq_management
RUN sudo chown -R rabbitmq:rabbitmq /var/lib/rabbitmq/

WORKDIR ~

# Expose ports.
EXPOSE 5672 15672

The error says that the node is not running, but I have not seen anything about starting a node in the documentation. In all the tutorial I looked at this should work.

Thanks everyone

1 Answer 1

1

As I did not found the error, I made it other way.

Dockerfile:

FROM rabbitmq:3.6.6-management

MAINTAINER victorcf999@gmail.com

ADD rabbitmq.config /etc/rabbitmq/

RUN chown rabbitmq:rabbitmq /etc/rabbitmq/rabbitmq.config
CMD ["rabbitmq-server"]

rabbitmq.config:

[
  {rabbit,
    [
        {default_vhost,<<"/">>},
        {default_user,<<"hyper">>},
        {default_pass,<<"hyperpass">>},
        {default_permissions, [<<".*">>, <<".*">>, <<".*">>]},
        {default_user_tags, [administrator]}
    ]
  },
  {rabbitmq_management,
    [{listener, [{port, 15672}]},
        {http_log_dir, "/var/log/rabbitmq/management_http.log"}]
  }
].

I hope this helps you

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.