docker - 如何卸载Docker Trusted Registry(DTR)?

标签 docker uninstallation docker-ucp dtr docker-ee

我已将DTR安装在单个管理器, worker 群集上(在设置适当的环境之前先玩弄它以获得更好的理解)

DTR安装成功。我想卸载DTR,并且卸载它没有任何问题。以下命令用于基于文档的卸载 Activity 。

docker run -it --rm \
>   docker/dtr:2.5.3 destroy \
>   --ucp-insecure-tls

运行docker ps确认与DTR关联的容器不再运行。

但是,当我登录到UCP时,仍然看到旧的DTR,并且看不到删除它的方法。

我感到困惑,不确定如何清理并创建新的DTR。

UCP UI DTR Config

最佳答案

docker / dtr会根据DTR CLI usage documentation强制销毁命令,并以非阻塞方式删除
现有DTR复制副本的卷和容器。

此外,正如在Docker论坛(https://forums.docker.com/t/uninstalling-dtr-doesnt-update-ucp-ui/31788/2)上所说,这似乎是DTR的老问题。

一个Docker知识库article中总结了如何修复它。
报告的步骤如下:

  • Run the following commands to view your current UCP configuration file


    # CURRENT_CONFIG_NAME will be the name of the currently active UCP configuration
    CURRENT_CONFIG_NAME=$(docker service inspect ucp-agent --format '{{range .Spec.TaskTemplate.ContainerSpec.Configs}}{{if eq "/etc/ucp/ucp.toml" .File.Name}}{{.ConfigName}}{{end}}{{end}}')
    
    # Collect the current config with `docker config inspect`
    docker config inspect --format '{{ printf "%s" .Spec.Data }}' $CURRENT_CONFIG_NAME > ucp-config.toml
    
  • Edit the ucp-config.toml file and remove the [[registries]] section for the stale DTR entry/entries at the bottom of the file.

  • Run the following commands to create and apply the configuration from the file:


     # NEXT_CONFIG_NAME will be the name of the new UCP configuration
     NEXT_CONFIG_NAME=${CURRENT_CONFIG_NAME%%-*}-$((${CURRENT_CONFIG_NAME##*-}+1))
    
     # Create the new swarm configuration from the file ucp-config.toml
     docker config create $NEXT_CONFIG_NAME ucp-config.toml
    
     # Use the `docker service update` command to remove the current configuration and apply the new configuration to the `ucp-agent` service.
     docker service update --config-rm $CURRENT_CONFIG_NAME --config-add source=$NEXT_CONFIG_NAME,target=/etc/ucp/ucp.toml ucp-agent
    
  • Wait few seconds for the restarting ucp-agent.

  • Confirm that the stale DTR entries are removed on the UCP UI (Username > Admin Settings > Docker Trusted Registry) page.

  • 关于docker - 如何卸载Docker Trusted Registry(DTR)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51397119/

    相关文章:

    docker - Hyperledger Fabric docker 组成CORE_PEER_GOSSIP_BOOTSTRAP

    docker - 如何在 gitlab-ci.yml 中使用 drush 作为服务?

    c# - 无法卸载 Windows 服务 : "...cannot be deleted, because it' s equal to the log name.“

    Docker compose 为堆栈设置容器名称

    docker :无法识别的服务

    postgresql - 即使提供所需的网络设置后也无法通过 docker 连接到 Postgresql

    windows - 当我们安装或卸载 .msi 或 .exe 包时会发生什么?

    c# - 在 Visual Studio 2017 安装项目中添加卸载时的自定义操作

    docker - Docker上的UCP和HTTP服务器共存

    ssl - 带有外部证书的 Docker Datacenter : Error x509 certificate signed by unknown authority UCP 2. 0.0 和 DTR 2.1.0