Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support saving images which are identified by SHA rather than tag #140

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ZimbiX
Copy link

@ZimbiX ZimbiX commented Apr 26, 2021

Hopefully resolves #17 and #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.

@MostefaKamalLala
Copy link

It would be nice if we can pass those sha to the cache action to pick what we want to cache no?

@ZimbiX
Copy link
Author

ZimbiX commented Jun 4, 2021

@MostefaKamalLala That sounds like a separate feature - there's an issue for it already, #121, as you've discovered.

Moetto added a commit to Moetto/wach2.0 that referenced this pull request Jul 22, 2021
Docker images saved by hash, i.e. kind cluster image, don't work with
satackey docker layer caching, causing build to fail.
See satackey/action-docker-layer-caching#140

Remove the broken plugin from use.
@memark
Copy link

memark commented Aug 25, 2021

What's the status on this? @ZimbiX @satackey

@ZimbiX
Copy link
Author

ZimbiX commented Aug 25, 2021

@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.

@ZimbiX
Copy link
Author

ZimbiX commented Nov 11, 2021

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

Example build

@ZimbiX
Copy link
Author

ZimbiX commented Nov 11, 2021

@satackey This is confirmed ready to review and merge

@ezequielgarcia
Copy link

@satackey @ZimbiX What's the status of this?

@ZimbiX
Copy link
Author

ZimbiX commented Jan 9, 2022

@ezequielgarcia We're still waiting for @satackey to review. In the meantime, you can use my fork with the line above =)

@ZimbiX
Copy link
Author

ZimbiX commented Mar 31, 2022

@satackey Are you still planning on maintaining this project? 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fails with docker images pulled by sha
4 participants