Hello, I am trying to cache and restore a docker image between builds. The docker directory is always empty when I run a new build and the image is pulled every time. From what I understand after the first run of this code the docker directory should contain the .tar archive. The tar is 12GB but even when I tried a text file it wasn’t restored.
I am basing my code on this https://circleci.com/docs/1.0/docker/#caching-docker-layers
Can someone explain why this isn’t working?
machine: services: - docker dependencies: cache_directories: - "~/docker" override: - docker login -e $QUAY_EMAIL -u $QUAY_USER -p $QUAY_PASS quay.io - if [[ -e ~/docker/image-5fa2c46.tar ]]; then docker load -i ~/docker/image-5fa2c46.tar; else docker pull quay.io/repo/image:commit-5fa2c46; fi - if [[ ! -e ~/docker/image-5fa2c46.tar ]]; then mkdir -p ~/docker; docker save -o ~/docker/image-5fa2c46.tar quay.io/repo/image:commit-5fa2c46; fi