action-docker-layer-caching
action-docker-layer-caching copied to clipboard
Support saving images which are identified by SHA rather than tag
Hopefully resolves https://github.com/satackey/action-docker-layer-caching/issues/17 and https://github.com/satackey/action-docker-layer-caching/issues/49.
Images can be pulled by SHA, but these don't get tagged, e.g.:
ruby:2.7.2-slim-buster@sha256:b9eebc5a6956f1def4698fac0930e7a1398a50c4198313fe87af0402cab8d149
We can't then use the repo plus non-existent tag to identify it in the call to docker save
. Instead, we can use the image ID, e.g.:
docker save redis:3.0 | tar xf - -C output1
docker save c44fa74ead88 | tar xf - -C output2
I'm fetching these details via:
$ docker image ls --format {{.Repository}}:{{.Tag}}:{{.ID}} --filter dangling=false
ruby:2.4:f172588bbb0b
ruby:<none>:ad10dfbc638b
...
This project badly needs some tests. In order to test this locally, I had to do so rather hackily.
I haven't tested out restoring yet. Putting this up here to share my progress.
It would be nice if we can pass those sha to the cache action to pick what we want to cache no?
@MostefaKamalLala That sounds like a separate feature - there's an issue for it already, https://github.com/satackey/action-docker-layer-caching/issues/121, as you've discovered.
What's the status on this? @ZimbiX @satackey
@memark I hadn't actually worked out how to use my fork, and I haven't needed to come back to this since. I was awaiting thoughts from @satackey here. If you figure it out, let me know.
I worked out how to use it the other day - the secret was to enable GitHub Actions on my fork, so it could automatically produce a *-release
branch with the TypeScript compiled. I could then use the below (I branched again to try things before I realised that, hence the different name):
uses: ZimbiX/action-docker-layer-caching@fix-error-cannot-use-import-statement-outside-a-module-release
@satackey This is confirmed ready to review and merge
@satackey @ZimbiX What's the status of this?
@ezequielgarcia We're still waiting for @satackey to review. In the meantime, you can use my fork with the line above =)
@satackey Are you still planning on maintaining this project? :pray: