Compose: Container already exist

Created on 13 Sep 2016  路  2Comments  路  Source: docker/compose

Hi... I am trying to run a container

image

However I receive an error that it already exist even when I list all of the containers with docker ps and there is no container listed.

The line inside the script is

docker run --name ldap-service --hostname ldap-service --detach osixia/openldap:1.1.1

kinquestion

Most helpful comment

Hi @pcastrotigre

docker ps only shows running containers. To see a list of all your containers, you should use docker ps -a - I'm quite confident the ldap-service will show up among them.

The simple solution here is of course to run docker rm -f ldap-service to remove the old container, and run your script again.

HTH!

All 2 comments

Hi @pcastrotigre

docker ps only shows running containers. To see a list of all your containers, you should use docker ps -a - I'm quite confident the ldap-service will show up among them.

The simple solution here is of course to run docker rm -f ldap-service to remove the old container, and run your script again.

HTH!

It worked great... Thanks

Was this page helpful?
0 / 5 - 0 ratings