cache icon indicating copy to clipboard operation
cache copied to clipboard

Warning: EACCES: permission denied, lstat '/var/lib/docker/image'

Open Nefcanto opened this issue 1 year ago • 1 comments

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.

Nefcanto avatar Feb 04 '24 08:02 Nefcanto

  1. ![FB_IMG_1707177108336](https://github.com/actions/cache/assets/159090726/68f891da-3dc2-4b48-9c07-d745e1b394d1)

Rayentaleb avatar Feb 06 '24 00:02 Rayentaleb