Skip to content

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

Open
ZimbiX wants to merge 1 commit into
satackey:mainfrom
ZimbiX:support-images-identified-by-sha
Open

Support saving images which are identified by SHA rather than tag#140
ZimbiX wants to merge 1 commit into
satackey:mainfrom
ZimbiX:support-images-identified-by-sha

Conversation

@ZimbiX

@ZimbiX ZimbiX commented Apr 26, 2021

Copy link
Copy Markdown

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
Copy Markdown

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

@ZimbiX

ZimbiX commented Jun 4, 2021

Copy link
Copy Markdown
Author

@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

memark commented Aug 25, 2021

Copy link
Copy Markdown

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

@ZimbiX

ZimbiX commented Aug 25, 2021

Copy link
Copy Markdown
Author

@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

ZimbiX commented Nov 11, 2021

Copy link
Copy Markdown
Author

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

ZimbiX commented Nov 11, 2021

Copy link
Copy Markdown
Author

@satackey This is confirmed ready to review and merge

@ezequielgarcia

Copy link
Copy Markdown

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

@ZimbiX

ZimbiX commented Jan 9, 2022

Copy link
Copy Markdown
Author

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

@ZimbiX

ZimbiX commented Mar 31, 2022

Copy link
Copy Markdown
Author

@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