question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Fails to get layer

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
ghostcommented, 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.

0reactions
crazy-maxcommented, Sep 9, 2020

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Docker - failed to create image: failed to get layer
I got the following error: failed to export image: failed to create image: failed to get layer sha256:xxxxxxxxxxxxx: layer does not exist.
Read more >
Docker build is failing because "failed to get layer"
Developer Community. We are seeing the error pasted to the end of this message. It seems to be an issue with docker. The...
Read more >
Failed to get layers information - Toradex Community
I reverted to creating a clean build, without my custom layers, following the instructions here, but I'm still seeing the same problem. I.e....
Read more >
Docker: failed to export/create/get image
Docker build failed with error failed to export image: failed to create image: failed to get layer. Here is how I solved it....
Read more >
Error: The layer, <layer_name>, cannot be added to the map
Additionally, the error message is returned when one or more layers on the web map are inaccessible in ArcGIS Online Map Viewer Classic...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found