Home > Software engineering >  Cassandra official guide docker start command network not working
Cassandra official guide docker start command network not working

Time:11-05

I am new to Docker and Cassandra and tried their quick start guide to setup Cassandra with Docker locally however meeting following issues.

I can successfully run the command to start Cassandra which is:

docker run --name cassandra cassandra

However when I tried with the command of network:

docker run --rm -d --name cassandra --hostname cassandra --network cassandra cassandra

it got failed with following errors:

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

Not quite sure what is the reason here? BTW, I am using the latest version of Docker for Mac as 4.1.1

CodePudding user response:

If you have not docker rm <existing container named cassandra>, second run with same name will be rejected. Do a docker ps -a to see if such container exist.

CodePudding user response:

The error means that you already have a container running called cassandra. You can't use the same name to start another container.

Run docker ps -a to list all containers on your Mac. If you don't need the container called cassandra anymore, you can terminate it with docker rm.

If you're interested, I find this Docker cheat sheet very handy since I'm not an expert either. Cheers!

  • Related