I’ve tried this - step two takes ~3 minutes and doesn’t seem to cache correctly.
The final step shows that the brew install command is correctly providing /usr/local/bin/convert
So, shouldn’t that file be restored correctly on subsequent runs?
Are you sure that the only modified file is at /usr/local/bin/convert? Usually when one does an install, lots of operating system dependencies are added as well.
I wonder if the install command does a compile rather than just a binary fetch. If so, could you create a new build pipeline to create a new Docker image that inherits from your existing build image?
I should think it would cache, yes - it just wouldn’t work if you ran it. Can you try building in a temporary ls -l /usr/local/bin/convert after the cache restore?