docker run --name test -e MYSQL_ROOT_PASSWORD=hello -d mysql:5.6
docker: Error response from daemon: Conflict. The name "/test" is already in use by container
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
使用 docker ps -a
$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
e60e7335dbb6 mysql "docker-entrypoint.sh" 34 hours ago Exited (1) 2 minutes ago 3306/tcp test
d7de7777925f ubuntu "/bin/bash" 35 hours ago Exited (0) 34 hours ago angry_bohr
$ docker start e60e7335dbb6
e60e7335dbb6
$ docker exec -it e60e7335dbb6 /bin/bash
或是使用 docker rm 去移除 container
$docker rm e60e7335dbb6
or
$docker rm -f e60e7335dbb6
沒有留言:
張貼留言