MysteryCoder456
MysteryCoder456

Reputation: 469

How do I uninstall Docker packages?

I wanted to install CVAT for training an Object Detection AI using Docker. The install failed for some reason in the middle and it wasn't installed. But all the files were still occupying space on my machine. I tried reinstalling the CVAT and the files keep adding to the occupied space. How do I remove all of these files? I am using a MacBook Pro with MacOS Big Sur Beta 4.

Edit: https://github.com/opencv/cvat/blob/develop/cvat/apps/documentation/installation.md#mac-os-mojave These are the commands I am running to install CVAT.

docker-compose build output: https://pastebin.com/7EkeQ289
docker-compose up -d output: https://pastebin.com/hF3GFDkX
docker exec -it cvat bash -ic 'python3 ~/manage.py createsuperuser output: https://pastebin.com/Mfh8CivL

Upvotes: 0

Views: 4656

Answers (1)

ryanwebjackson
ryanwebjackson

Reputation: 1048

If you are trying to remove the containers, attempt the following:

1. docker ps -a - lists all containers
2. docker stop [label or SHA of the containers you want to remove]

  1. docker-compose down [YAML configuration file you targeted with docker-compose up] - this should stop all containers, teardown networks, etc. that docker-compose started with 'up'
  2. docker container prune - removes all stopped containers
    NOTE: If you have other stopped containers that you want to keep, do not run this, but remove them individually, as I suggested in the stricken-through step two above, or Konrad Botor's comment

https://docs.docker.com/compose/reference/down/ https://docs.docker.com/engine/reference/commandline/container_prune/

If you want to remove the images:

  1. docker images
  2. docker rmi [label or SHA] (RMI is the remove image command)

https://docs.docker.com/engine/reference/commandline/images/ https://docs.docker.com/engine/reference/commandline/rmi/

To speed up this process, analyze the YAML configuration file being targeted for your docker-compose build command, and/or reference the documentation for that specific project (CVAT) if available, to determine what containers (software) it is initializing (and how it is doing so, if necessary). It might help to paste its contents in the question.

Note: what is taking up space may be volumes which are not cleaned up properly by the docker build scripts for this project. See the following documentation on how to remove those: https://docs.docker.com/engine/reference/commandline/volume_rm/

I might be missing some context, as I cannot access your pastebin links (behind a firewall at the moment).

Upvotes: 2

Related Questions