The container name “/xx“ is already in use by container “xx“. You have to remove (or rename) that

1、问题

D:\Users\chengyq>docker run -d --name clickhouse-server --ulimit nofile=262144:262144 -p 8123:8123 -v //D/clickhouse/config.xml:/etc/clickhouse-server/config.xml --volume=//D/clickhouse:/var/lib/clickhouse yandex/clickhouse-server
docker: Error response from daemon: Conflict. The container name "/clickhouse-server" is already in use by container "c1760937eac6d9838fa356daa30a03acd16c7c7709eeb9c6677b18b98ff19abc". You have to remove (or rename) that container to be able to reuse that name.
See 'docker run --help'.

提示:容器名被占用,需要移除或重命名这个容器名

2、解决办法

D:\Users\chengyq>docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES

先查看所有的容器

D:\Users\chengyq>docker ps -a
CONTAINER ID        IMAGE                                  COMMAND                  CREATED             STATUS                           PORTS               NAMES
77156067410e        spoonest/clickhouse-tabix-web-client   "/bin/sh -c ./start.…"   About an hour ago   Exited (137) 3 minutes ago                           unruffled_merkle
e012683b9783        spoonest/clickhouse-tabix-web-client   "/bin/sh -c ./start.…"   About an hour ago   Exited (137) About an hour ago                       gifted_rubin
c1760937eac6        yandex/clickhouse-server               "/entrypoint.sh"         2 hours ago         Exited (0) 26 minutes ago                            clickhouse-server
19600aac5981        redis                                  "docker-entrypoint.s…"   24 hours ago        Exited (0) 3 minutes ago                             redis

移除容器

D:\Users\chengyq>docker rm c1760937eac6
c1760937eac6

D:\Users\chengyq>docker ps -a
CONTAINER ID        IMAGE                                  COMMAND                  CREATED             STATUS                           PORTS               NAMES
77156067410e        spoonest/clickhouse-tabix-web-client   "/bin/sh -c ./start.…"   About an hour ago   Exited (137) 5 minutes ago                           unruffled_merkle
e012683b9783        spoonest/clickhouse-tabix-web-client   "/bin/sh -c ./start.…"   About an hour ago   Exited (137) About an hour ago                       gifted_rubin
19600aac5981        redis                                  "docker-entrypoint.s…"   24 hours ago        Exited (0) 4 minutes ago                             redis

D:\Users\chengyq>
©️2020 CSDN 皮肤主题: 创作都市 设计师:CSDN官方博客 返回首页