How can I remove my cached docker layers?

You may run into issues with cached docker layers when using them within your config, if this occurs you can try removing the layers

Remove the layers

Running docker images --no-trunc --format '{{.ID}}' | xargs docker rmi or docker volume prune -f will delete all of the images and their layers from the volume connected to your job.

Because of how Docker Layer Caching (DLC) works you might need to leave this command in your config and run several jobs to remove the Docker Layer Caching (DLC) layers from all volumes associated with your project.

You can use the config below to run a very short job that consumes all 50 DLC volumes and purges docker caches. You can push it to a feature branch without disrupting your main branches:

version: 2.1
jobs:
docker-purge:
docker
:
- image: cimg/base:2020.01
parallelism: 50
steps:
- setup_remote_docker
- run: docker volume prune -f

Stale volumes

If you're running into issues where stale volume caches are causing problems often, then consider using our new docker registry image cache orb as a substitute. It's more suitable for projects that have high concurrency throughput, or jobs that use parallelism due to the limited number of volumes available.

If you notice errors always happen on the same volume, which you can see by checking the "spin up environment" step or "remote docker" please contact support 

Was this article helpful?
26 out of 70 found this helpful

Comments

0 comments

Article is closed for comments.