gpt4 book ai didi

docker - 停止并删除自动启动的 docker 容器

转载 作者:行者123 更新时间:2023-12-04 15:00:21 29 4
gpt4 key购买 nike

我有几个容器要删除。当我停止它们时,它们会重新启动,所以我无法删除它们。我尝试使用命令 sudo docker update --restart=no [docker name] 更新它们,但它们仍在重新启动。

这是我的 docker ps 的输出:

    ~$ sudo docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
8482a3ba7a1c homeassistant/amd64-hassio-dns:2021.01.0 "/init" About a minute ago Up About a minute hassio_dns
bf6edaa5add5 homeassistant/amd64-hassio-multicast:2021.04.0 "/init" 8 minutes ago Up 8 minutes hassio_multicast
f53752b4920f homeassistant/amd64-hassio-audio:2021.02.1 "/init" 8 minutes ago Up 8 minutes hassio_audio
2b5ed16c305d homeassistant/amd64-hassio-cli:2021.03.1 "/init /bin/bash -c …" 9 minutes ago Up 9 minutes hassio_cli
27fdf9452c85 homeassistant/amd64-hassio-observer:2020.10.1 "/init" 9 minutes ago Up 9 minutes 0.0.0.0:4357->80/tcp hassio_observer
612417c38db1 homeassistant/amd64-hassio-supervisor "/init" 6 days ago Up 16 minutes hassio_supervisor

它们在 Synology NAS 上运行

最佳答案

谷歌搜索您正在运行的图像,看起来您可能已经安装了 this supervised tool :

This system will run the Home Assistant Supervisor. The Supervisor is not just an application, it is a full appliance that manages the whole system. It will clean up, repair or reset settings to default if they no longer match expected values.

我的理解是,如果您删除一个容器,该工具可能会重新创建它。

阅读安装程序脚本,它会运行:

systemctl enable hassio-apparmor.service > /dev/null 2>&1;
systemctl start hassio-apparmor.service

所以要禁用,请尝试:

systemctl disable hassio-apparmor.service
systemctl stop hassio-apparmor.service

然后您可以删除容器(-f 运行初始 docker kill,这可能会导致这些容器安装的任何文件的数据损坏):

docker container rm -f \
hassio_dns \
hassio_multicast \
hassio_audio \
hassio_cli \
hassio_observer \
hassio_supervisor

关于docker - 停止并删除自动启动的 docker 容器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67048944/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com