Skip to content

Removing Docker containers on the master host

Occasionally, stopping the Control Center service leaves Docker containers in the local registry. Perform this procedure on the Control Center master host to ensure no containers remain.

  1. Gain access to the Control Center host, through the console interface of your hypervisor, or through a remote shell utility such as PuTTY.

  2. Start a command-line session as root.

    1. In the Appliance Administration menu, select Root Shell.
    2. Select Run, and then press Enter.

    The menu is replaced by a command prompt similar to the following example:

    [root@hostname ~]#
    
  3. Stop the Control Center service.

    systemctl stop serviced
    
  4. Ensure that no containers remain in the local repository.

    1. Display the identifiers of all containers, running and exited.

      docker ps -qa
      
      • If the command returns no result, stop. This procedure is complete.
      • If the command returns a result, perform the following substeps.
    2. Remove all remaining containers.

      docker ps -qa | xargs --no-run-if-empty docker rm -fv
      
    3. Display the identifiers of all containers, running and exited.

      docker ps -qa
      
      • If the command returns no result, stop. This procedure is complete.
      • If the command returns a result, perform the remaining substeps.
    4. Disable the automatic startup of serviced.

      systemctl disable serviced
      
    5. Reboot the host.

      reboot
      
    6. Log in to the master host as root, or as a user with superuser privileges.

    7. Enable the automatic startup of serviced.

      systemctl enable serviced
      

To return to the Appliance Administration menu, enter the exit command.