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 to get layer #79

Closed
AndriyKalashnykov opened this issue Jul 23, 2020 · 8 comments
Closed

Fails to get layer #79

AndriyKalashnykov opened this issue Jul 23, 2020 · 8 comments
Milestone

Comments

@AndriyKalashnykov
Copy link

AndriyKalashnykov commented Jul 23, 2020

When running build-push-action - specifically this workflow run
on multi-stage Docker image following error occurs:

Step 18/22 : COPY --from=build --chown=nonroot:nonroot /tmp/target/spring-boot-loader/ ./
failed to export image: failed to create image: failed to get layer sha256:d2b5fefe683206943d83635f6efab18fba2f951b676432c3932047d3cb348381: layer does not exist
@ghost
Copy link

ghost commented Aug 6, 2020

Did you ever figure out what was going on? I'm getting the same issue -- the spring-boot-loader layer not being found, reliably, in a Azure DevOps build (which seems to use, these days, the same underlying engine as the public github infrastructure).

Strangely, in one build definition it reliably works, and the exact same Dockerfile run in a second one doesn't, and the build output of the failed one, if downloaded and run against the Dockerfile, does work. I'm starting to think the issue is something on Microsoft's side, not in Docker or Spring's layer generation, but I haven't been able to figure out how to get any more data on it.

@AndriyKalashnykov
Copy link
Author

Did you ever figure out what was going on? I'm getting the same issue -- the spring-boot-loader layer not being found, reliably, in a Azure DevOps build (which seems to use, these days, the same underlying engine as the public github infrastructure).

Strangely, in one build definition it reliably works, and the exact same Dockerfile run in a second one doesn't, and the build output of the failed one, if downloaded and run against the Dockerfile, does work. I'm starting to think the issue is something on Microsoft's side, not in Docker or Spring's layer generation, but I haven't been able to figure out how to get any more data on it.

Nope, didn't figure it out yet. Are there any other actions that can do similar thing?

@leordev
Copy link

leordev commented Aug 8, 2020

Same here ☹️: https://github.com/CodigoPraTodos/cursospratodos/runs/961837303
Check the step: 🐳 Build and push Docker images

@ghost
Copy link

ghost commented Aug 9, 2020

So I actually figured this out. It seems to be a timing-related thing.

Add a "RUN true" between each copy step.

So:

COPY ...
RUN true
COPY ...
RUN true
COPY ...

etc

That fixed it reliably for me.

@crazy-max
Copy link
Member

crazy-max commented Sep 2, 2020

Hi,

Can you try with the future build-push-action v2 (#92)?

@crazy-max crazy-max added this to the v2 milestone Sep 2, 2020
@AndriyKalashnykov
Copy link
Author

Hi,

Can you try with the future build-push-action v2 (#92)?

Seems to have the same error, take a look https://github.com/AndriyKalashnykov/spring-microservices-k8s/runs/1062414050?check_suite_focus=true

@crazy-max
Copy link
Member

crazy-max commented Sep 2, 2020

@AndriyKalashnykov Inputs have changed in v2. See Usage section and also this workflow as an example.

@crazy-max
Copy link
Member

Version 2 has been merged to the main branch and is therefore available via uses: docker/build-push-action@v2 (mutable tag).

As a reminder, this new version changes drastically and works with 3 new actions (login, setup-buildx and setup-qemu) that we have created. Many usage examples have been added to handle most use cases.

And it should fix this current issue. Don't hesitate if you have any questions.

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

No branches or pull requests

3 participants