Docker Community Forums

Share and learn in the Docker community.

Removal of incompletely built docker binaries

After adding my changes, I issued the make binary command to create the binaries but due to insufficient space in the disk, the command could not complete at the last moment of its execution. I notice that this incomplete run has consumed a coupe of gigabytes of disk space. Is there a way to track down and delete the files/directories which were generated in this process to restore disk space?

make binary command builds binaries from within containers, and uses other temporary containers to assist this process. If you run “docker images”, you will see a lot of images with names and tags both as “<none>”. You could free up some space by deleting these(docker image rm imageid1 imageid2 imageid3 … ), as these are the “temporary files” that were created during installation.

Thanks for the prompt reply! Yes, I did remove the newly created images in previous runs when the make binary was successful, to clear up some space. However, for the incomplete run, I do not see any images created under docker images so I suspected if any other files were getting generated and occupying disk space. After two of such incomplete runs, the available disk space has shrunk a bit.

You can use the new docker system prune command. I have an alias that I use from time to time just to clean out everything. It looks like this.

docker container stop $(docker container ls -a -q) && docker system prune -a -f --volumes