skip to Main Content

I am new to docker. I have been assigned with a task that uses Docker container for development. I followed the tutorial for installing the Docker and the containers on Windows 10, but I have the following error: network remaxmdcrm_remaxmd-network declared as external, but could not be found

The steps I’ve done so far are:

  1. Cloned the repository from GitHub.
  2. Installed Docker on my laptop.
  3. Once I installed Docker, I went in the root of my project and ran the following command. docker-compose build -d -t docker-compose.yml – docker-compose.yml being the file in the root dir.
  4. I opened Docker app and I ran the images created.
  5. I ran the command docker-compose up. When I ran this command, the error I specified at the beginning appears. network remaxmdcrm_remaxmd-network declared as external, but could not be found

docker-compose.yml

services:
    ui:
        build:
            context: .
            dockerfile: Dockerfile.development
        volumes:
            - .:/app
        ports:
            - "5000:5000"
        restart: unless-stopped
        networks:
            - remaxmdcrm_remaxmd-network

    redis:
        image: 'redis:alpine'
        networks:
            - remaxmdcrm_remaxmd-network
networks:
    remaxmdcrm_remaxmd-network:
        external: true

Ran: docker ps -a

ID              IMAGE
5e6cf997487c   remaxmd-site_ui:latest      
451009e0a2a6   redis:alpine                
85e7cde67d05   docmer-compose.yml:latest 

I might do something wrong here. Can somebody help me? I much appreciate your time!

3

Answers


  1. Chosen as BEST ANSWER

    I solved the issue, finally. The issue came from the fact that I had in docker-compose.yml remaxmdcrm_remaxmd-network declared as external. The external network was not created during installation, thus I needed to create a bridging network. I ran the command docker network create "name_of_network"

    For further details, here is the full documentation this


  2. You can see docker network ls and uses bridge network

    Login or Signup to reply.
  3. You shouldn’t have to run a command to create the network prior to running docker compose, Docker should create the network if it doesn’t exist. The reason you’re getting this error is because you’re declaring the network as external, which means that Docker expects it to already exist. If you need a new one, remove external: true

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search