- run:
name: Save Docker image layer cache
command: |
mkdir -p caches
docker save -o /caches/app.tar app
It worked fine for a long time but suddenly I am seeing this:
failed to save image: unable to validate output path: directory "/caches" does not exist
Exited with code 1
Why isn’t mkdir -p caches working?
I had the same problem with mkdir -p test-results/coverage test-results/nose
The directories wouldn’t be found with mkdir and I ended up having to just put a .gitkeep in those folders.
But /caches/ did work until recently. Overall I really don’t get why mkdir doesn’t seem to actually create directories.
I’ll try that. But it was working fine before for a while the way it is now. Not sure why suddenly it isn’t. I have the same problem with the test results directories. Although they had the issue from the start.
Makes no sense to me why it wouldn’t work. Hopefully your suggestion fixes it even if it doesn’t explain why it worked fine until now
Was working_directory set to / at any point, by any chance? It could also be a change to the image – if you go back to the last time it succeeded, under “spin up containers” you should be able to view the sha256 digest of the image. You can then pin this by specifying (for example):