cache
cache copied to clipboard
Warning: EACCES: permission denied, lstat '/var/lib/docker/image'
I want to cache the pulled docker images. This is the YAML file I wrote:
- name: Change Docker image directory ownership
run: sudo chown -R $USER:$USER /var/lib/docker/image
- name: Cache Docker
uses: actions/cache@v4
with:
path: |
/var/lib/docker/image
key: docker-layers-${{ runner.os }}-pull-image
- name: Pull images
run: |
docker pull holism/panel
docker pull node:lts-bookworm-slim
The problem is that the Post step for Cache Docker can not access the /var/lib/docker/image directory:
Post job cleanup. Warning: EACCES: permission denied, lstat '/var/lib/docker/image'
I even tried to make it world-writable and executable by using run: sudo chmod -R 777 --preserve-root /var/lib/docker/image, yet I still get that error.
I think it's a bug of your action that does not perform the chmod or can not perform it on the target directory. Therefore I reported it.
I have also seen https://github.com/actions/cache/issues/81 and https://github.com/actions/cache/issues/31.
