How to clear docker build cache (keeps saying 0B reclaimed)

Viewed 1572

I just ran docker buildx build and it ran for about 10 minutes, but yet when I try to clear the build cache, it keeps saying that 0B was reclaimed. I'm obviously misunderstanding something here.

Here's my total output:

ubuntu@ip-10-20-65-45:~$ docker buildx build --platform linux/arm/v7 .
WARN[0000] No output specified for docker-container driver. Build result will only remain in the build cache. To push result image into registry use --push or to load image into docker use --load
[+] Building 6000.2s (5/5) FINISHED
 => [internal] load build definition from Dockerfile                                                                                                                                                                                                                                                                                                                   0.1s
 => => transferring dockerfile: 32B                                                                                                                                                                                                                                                                                                                                    0.0s
 => [internal] load .dockerignore                                                                                                                                                                                                                                                                                                                                      0.0s
 => => transferring context: 2B                                                                                                                                                                                                                                                                                                                                        0.0s
 => [internal] load metadata for docker.io/kalilinux/kali-rolling:latest                                                                                                                                                                                                                                                                                               1.1s
 => CACHED [1/2] FROM docker.io/kalilinux/kali-rolling@sha256:8ce5177e07c182e6635cf303f8e3daceface00f0f40b27c34ab033cfb49bcbbd                                                                                                                                                                                                                                         0.0s
 => => resolve docker.io/kalilinux/kali-rolling@sha256:8ce5177e07c182e6635cf303f8e3daceface00f0f40b27c34ab033cfb49bcbbd                                                                                                                                                                                                                                                0.0s
 => [2/2] RUN apt update &&     apt dist-upgrade -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" &&     apt autoremove -y &&     apt clean -y &&     if [ "linux/arm/v7" = "linux/arm/v7" ] ; then     apt install wget -y &&     wget http://ftp.us.debian.org/debian/pool/main/libs/libseccomp/libseccomp2_2.5.1-1_armhf.deb -O lib  5999.0s
ubuntu@ip-10-20-65-45:~$ docker builder prune
WARNING! This will remove all dangling build cache. Are you sure you want to continue? [y/N] y
Total reclaimed space: 0B
ubuntu@ip-10-20-65-45:~$ docker build prune
unable to prepare context: path "prune" not found
ubuntu@ip-10-20-65-45:~$ docker image ls -a
REPOSITORY      TAG               IMAGE ID       CREATED       SIZE
moby/buildkit   buildx-stable-1   cf14c5e88c0e   2 weeks ago   123MB
ubuntu@ip-10-20-65-45:~$ docker builder prune -a
WARNING! This will remove all build cache. Are you sure you want to continue? [y/N] y
Total reclaimed space: 0B
ubuntu@ip-10-20-65-45:~$ docker builder prune -af
Total reclaimed space: 0B
ubuntu@ip-10-20-65-45:~$ docker buildx prune -af
ID                                                                      RECLAIMABLE     SIZE    LAST ACCESSED
r9fb1b3q8jmu7ann44vvjtpi5*                                              true            4.10kB
xiw6rtbwe2xtd9s8xghdgcz70                                               true            154.88MB
Total:  154.88MB
ubuntu@ip-10-20-65-45:~$

The most I was able to get back was 154MB, but I know these images are much bigger than this. How do I properly clear out the cache from docker buildx build?

0 Answers
Related