-1

I was trying to install odoo:

docker run -d -e POSTGRES_USER=odoo -e POSTGRES_PASSWORD=odoo -e POSTGRES_DB=postgres --name db postgres:10

At first, I got the following error:

 docker: Error response from daemon: Conflict. The container name "/odoo" is already in use by container "57b42767f67725ecb95eb71c0381824caa18b24d45239c5c19bd88ce89663343".
 You have to remove (or rename) that container to be able to reuse that name.

when I try to remove and replace it I get these errors:

 docker: Error response from daemon: Cannot link to a non running container: /db AS /odoo/db.
ERRO[0002] error waiting for the container: context canceled 

Does anyone know how to fix it?

dejanualex
  • 3,872
  • 6
  • 22
  • 37
  • You need to completely delete the existing container set before launching a new one. What commands are you trying to run; can you edit the question to add a relevant fragment of your application code? (You should not need "link" at all in modern Docker, but there is an alternate networking setup required if you're manually running `docker run` commands.) – David Maze Jan 18 '21 at 05:24
  • Also see [docker error - 'name is already in use by container'](https://stackoverflow.com/questions/31697828/docker-error-name-is-already-in-use-by-container), which explains the first error, and [Docker Cannot link to a non running container](https://stackoverflow.com/questions/32147554/docker-cannot-link-to-a-non-running-container), with a specific Compose-based case for the second. – David Maze Jan 18 '21 at 05:26

1 Answers1

0

Completely remove the current odoo container and then make sure you put both the odoo container and the postgres containers in the same docker network, that way they'll communicate with each other, and you won't need to link anything.

J. Scott Elblein
  • 4,013
  • 15
  • 58
  • 94