Uninstalling Docker
Perform the following steps to uninstall Docker:
- Delete all running containers.
1docker rm -vf $(docker ps -a -q)
To back up a running container, run the docker commit command to save the container as an image.
1docker commit -m "<message>" -a "<author>" <Container ID> <Image name>:<tag>
The backup of image will be described in the following.
- Delete all local images.
1docker rmi -f $(docker images -a -q)
To back up a Docker image to a local file, run the docker save command to save the image as a .rar file.
1docker save -o <File name>.rar <Image name>:<tag>
- Delete the Docker components from /usr/bin.
- Query the Docker components in /usr/bin.
1ll

- Delete these components in sequence.
1rm -f /usr/bin/<Component name>
- Query the Docker components in /usr/bin.
- Reset the docker.service configuration file.
- Clear the docker.service file.
1echo '' > /usr/lib/systemd/system/docker.service
- Reload the daemon service.
1systemctl daemon-reloadDocker is uninstalled.
- Clear the docker.service file.
Parent topic: More Information