--Umgebung - CentOS Linux release 7.6.1810 (Core) - Docker Version:18.09.6
Löschen Sie den Container
$ docker rm {Container-ID oder Containername}
#Alle Container anzeigen, einschließlich angehaltener Container
$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
dffe12345678 host_delete-target "/usr/sbin/init" 24 hours ago Up 3 hours 0.0.0.0:18080->8080/tcp, 0.0.0.0:18082->8081/tcp delete-target
93abcdefghij host_hoge "/usr/sbin/init" 4 months ago Up 3 hours 0.0.0.0:8088->3389/tcp, 0.0.0.0:8089->8080/tcp hoge
#Wenn es läuft, stoppen Sie es
$ docker-compose stop delete-target
Stopping delete-target ... done
#Schauen wir uns den Zustand noch einmal an
$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
dffe12345678 host_delete-target "/usr/sbin/init" 24 hours ago Exited (137) 52 seconds ago delete-target
93abcdefghij host_hoge "/usr/sbin/init" 4 months ago Up 3 hours 0.0.0.0:8088->3389/tcp, 0.0.0.0:8089->8080/tcp hoge
#löschen
$ docker rm delete-target
delete-target
#Stellen Sie sicher, dass der gelöschte Container verschwunden ist
$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
93abcdefghij host_hoge "/usr/sbin/init" 4 months ago Up 3 hours 0.0.0.0:8088->3389/tcp, 0.0.0.0:8089->8080/tcp hoge
Stop the container before attempting removal or force remove
$ docker rm dffe12345678
Error response from daemon: You cannot remove a running container dffe... Stop the container before attempting removal or force remove
Can't find a suitable configuration file in this directory or any parent.
$ docker-compose stop delete-target
ERROR:
Can't find a suitable configuration file in this directory or any
parent. Are you in the right directory?
Supported filenames: docker-compose.yml, docker-compose.yaml
Recommended Posts