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

Fails with docker images pulled by sha #17

Open
kshpytsya opened this issue Aug 7, 2020 · 8 comments · May be fixed by #140
Open

Fails with docker images pulled by sha #17

kshpytsya opened this issue Aug 7, 2020 · 8 comments · May be fixed by #140
Labels
bug Something isn't working

Comments

@kshpytsya
Copy link

kshpytsya commented Aug 7, 2020

Docker provides a way for referring to images by their SHA hash instead of tags, like this:

$ docker pull pierrezemb/gostatic@sha256:e28d48e17840c5104b5133c30851ac45903b1d2f268d108c4cd0884802c9c87e
$ docker images|grep gostatic
pierrezemb/gostatic                                                              <none>                         4569615e9ed0        2 weeks ago
      7.72MB

Notice the <none> part.

Now, apparently this causes the docker layer caching action to do the equivalent of following under the hood:

$ docker history -q 'pierrezemb/gostatic:<none>'
Error response from daemon: invalid reference format

In the logs of Github build I see:

docker history -q pierrezemb/gostatic:<none>










Error: The process '/usr/bin/docker' failed with exit code 1
    at ExecState._setResult (/home/runner/work/_actions/satackey/action-docker-layer-caching/v0.0.5/dist/ttsc-dist/post.js/index.js:1300:25)
    at ExecState.CheckComplete (/home/runner/work/_actions/satackey/action-docker-layer-caching/v0.0.5/dist/ttsc-dist/post.js/index.js:1283:18)
    at ChildProcess.<anonymous> (/home/runner/work/_actions/satackey/action-docker-layer-caching/v0.0.5/dist/ttsc-dist/post.js/index.js:1183:27)
    at ChildProcess.emit (events.js:210:5)
    at maybeClose (internal/child_process.js:1021:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
##[error]Error: The process '/usr/bin/docker' failed with exit code 1
@kshpytsya kshpytsya added the bug Something isn't working label Aug 7, 2020
kyrylo-shpytsya-prism added a commit to prismai/spark-on-nomad that referenced this issue Aug 7, 2020
Also, switch to pierrezemb/gostatic:latest instead
of specific hash due to
satackey/action-docker-layer-caching#17
kyrylo-shpytsya-prism added a commit to prismai/spark-on-nomad that referenced this issue Aug 7, 2020
Also, switch to pierrezemb/gostatic:latest instead
of specific hash due to
satackey/action-docker-layer-caching#17
@satackey
Copy link
Owner

satackey commented Aug 8, 2020

I hadn't considered pulling by digest, I'll fix it soon.

Thank you for your report!

@peterbe
Copy link

peterbe commented Sep 2, 2020

I'm getting the same error here:

Post job cleanup.
Error: The process '/usr/bin/docker' failed with exit code 1
    at ExecState._setResult (/home/runner/work/_actions/satackey/action-docker-layer-caching/v0.0.8/dist/ttsc-dist/post.js/index.js:1300:25)
    at ExecState.CheckComplete (/home/runner/work/_actions/satackey/action-docker-layer-caching/v0.0.8/dist/ttsc-dist/post.js/index.js:1283:18)
    at ChildProcess.<anonymous> (/home/runner/work/_actions/satackey/action-docker-layer-caching/v0.0.8/dist/ttsc-dist/post.js/index.js:1183:27)
    at ChildProcess.emit (events.js:210:5)
    at maybeClose (internal/child_process.js:1021:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
##[error]Error: The process '/usr/bin/docker' failed with exit code 1

https://github.com/mdn/kuma/runs/1063849218

My config can be seen here https://github.com/mdn/kuma/pull/7456/files#diff-12a86cef0c4707531fdbabac3e38cb2aR27 if that helps.
Is it because I'm not specifying a key?

@raphaelvigee
Copy link

raphaelvigee commented Nov 29, 2020

I'm encountering the same issue, any solution for it ?

@rcowsill
Copy link
Contributor

I'm getting the same error here: [...]
Is it because I'm not specifying a key?

That looks like the same issue as the OP; the kuma_base Dockerfile specifies a source image by digest. That image isn't dangling so the action expects it to have a valid tag instead of <none>.

I'm encountering the same issue, any solution for it ?

Until this issue is resolved I think the only workaround is to specify images by tag instead of by digest.

@ruohola
Copy link

ruohola commented Apr 10, 2021

One thing to also consider is to keep support for specifying the tag AND the hash. This form is common even though the tag here does absolutely nothing, but only helps the reader:

FROM python:3.9.4-slim-buster@sha256:de9482638c1354f5178efc90431de2a42e863a12bf3df41d7fa30d5c10fe543d

One useful trick know is that you don’t have to remove the tag if you want to add a digest. If both are present then the tag is ignored, so you can leave it in for human readability

https://www.whitesourcesoftware.com/free-developer-tools/blog/overcoming-dockers-mutable-image-tags/

@rcowsill
Copy link
Contributor

rcowsill commented Apr 11, 2021

One thing to also consider is to keep support for specifying the tag AND the hash.

I've just confirmed that docker does treat that form exactly the same as only specifying the hash. That means that it'll just work when the action supports images specified by hash.

@ruohola
Copy link

ruohola commented Apr 11, 2021

One thing to also consider is to keep support for specifying the tag AND the hash.

I've just confirmed that docker does treat that form exactly the same as only specifying the hash. That means that it'll just work when the action supports images specified by hash.

Yes, to Docker:

FROM python:3.9.4-slim-buster@sha256:de9482638c1354f5178efc90431de2a42e863a12bf3df41d7fa30d5c10fe543d

and

FROM python@sha256:de9482638c1354f5178efc90431de2a42e863a12bf3df41d7fa30d5c10fe543d

are identical. Just wasn't familiar with this Action's internals and wanted to give a heads up about it :)

ruohola added a commit to skoleapp/skole-frontend that referenced this issue Apr 15, 2021
The action currently hash a bug where it won't work at all with images
pulled by digest:
satackey/action-docker-layer-caching#17
ruohola added a commit to skoleapp/skole-backend that referenced this issue Apr 15, 2021
The action currently hash a bug where it won't work at all with images
pulled by digest:
satackey/action-docker-layer-caching#17
@ghost
Copy link

ghost commented Jul 29, 2021

Any updates on this?
I am getting the same Error: The process '/usr/bin/docker' failed with exit code 1 in the Post Layer Cache step, on the first run, with the following configuration:
code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants