Receiving pull access denied error while trying to run docker-compose.yml file

Viewed 4787

In building a microservices-based app using node.js and docker. I created my docker-compose.yml file, however when I try to run execute the command "docker-compose up -d", I keep getting the following error message: "ERROR: pull access denied for rabbbitmq, repository does not exist or may require 'docker login'". Here is a sample of my docker-compose.yml file:

version: '2'
services:
  myservice1:
    container_name: “myapp_myservice1”
    build:
      context: ../../MyService1
      dockerfile: dev.Dockerfile
    command: npm start
    volumes:
      - ../../MyService1:/usr/src/app/
    ports:
      - "3000:3000"
    depends_on:
      - mongo
      - rabbitmq
      - nginx
  myservice2:
    container_name: “myapp_myservice2”
    build:
      context: ../../MyService2
      dockerfile: dev.Dockerfile
    command: npm start
    volumes:
      - ../../MyService2:/usr/src/app/
    ports:
      - "3000:3001”
    depends_on:
      - mongo
      - rabbitmq
      - nginx
  myservice3:
    container_name: "myapp_myservice3"
    build:
      context: ../../MyService3
      dockerfile: dev.Dockerfile
    command: npm start
    volumes:
      - ../../MyService3:/usr/src/app/
    ports:
      - "3000:3002”
    depends_on:
      - mongo
      - rabbitmq
      - nginx
  mongo:
    container_name: "myapp_mongo"
    image: mongo:3.5.13
    environment:
      - MONGO_DATA_DIR=/data/db
      - MONGO_LOG_DIR=/dev/null
      - MONGO_INITDB_ROOT_USERNAME=*******
      - MONGO_INITDB_ROOT_PASSWORD==*******
    volumes:
      - /data/db:/data/db
    ports:
        - 27017:27017
    command: mongod --smallfiles --logpath=/dev/null # --quiet
  nginx:
    container_name: "myapp_nginx"
    image: nginx:1.13.6
    ports:
      - "80:80"
      - "8080:8080"
    volumes:
      - ./nginx/conf:/etc/nginx/conf.d
    command: /bin/bash -c "envsubst < /etc/nginx/conf.d/mysite.template > /etc/nginx/conf.d/default.conf && nginx -g 'daemon off;'"
  rabbitmq:
    container_name: "myapp_rabbitmq"
    image: rabbbitmq:latest
    environment:
      - RABBITMQ_ERLANG_COOKIE='secret_cookie'
    hostname: fourthreefortymq
    ports:
      - "15672:15672"
      - "5672:5672"
    tty: true
    volumes:
      - ./rabbitmq/lib:/var/lib/rabbitmq
      - ./rabbitmq/log:/var/log/rabbitmq
      - ./rabbitmq/conf:/etc/rabbitmq/

and here is a sample of my dev.Dockerfile:

FROM node:latest (I commented out the rest of this file)

It tries to run rabbitmq first and then it fails with the error message. I even tried to create a new account for docker hub and login followed by running the command but I am still getting the same error message. Additionally, I ran the command "docker inspect rabbitmq" from the terminal screen and I received a json arry response back. I would assume this means it exists and is reachable. Can someone please review the code below and let me know what I am missing?

2 Answers

You have an extra 'b' in rabbitmq image name, it should be rabbitmq:latest and not rabbbitmq:latest.

docker-compose build will build everything locally for you based on docker-compose.yml, and doesn't need to pull from remote repos.

After running the above command, you can run docker-compose up -d to run a container on the built images.

This is just a first-time thing and after changing anything locally and then needing to re-create the containers and images you can run docker-compose up -d --build

Related