appsody / stacks

Appsody application stacks. This repo will be archived soon.
https://appsody.dev
Apache License 2.0
89 stars 121 forks source link

java-openliberty: Work around docker bug #816

Closed matthewpwilson closed 4 years ago

matthewpwilson commented 4 years ago

Checklist:

Modifying an existing stack:

When trying to do an appsody build using the java-openliberty stack in a GitHub Actions, CI environment, I hit the following error:

[Docker] Step 18/68 : COPY --chown=1001:0 --from=compile /configlibdir/ /config
[Docker] failed to export image: failed to create image: failed to get layer sha256:27f55a0113aeec813a6bb31695fd2449c4dc13fe53adb7a67e144c325b63bdf7: layer does not exist
[Error] exit status 1

This appears to be caused by moby/moby#37965. The characteristics of the COPY don't exactly match the description in the issue but the symptom is the same. This issue has been open for a while and there's no sign of a fix so I think it's worth putting a workaround in the stack. I've added the suggested RUN true, which fixes the issue for me. It seems like subsequent COPY commands could hit the same issue, but in practice they don't for me, so I've just put in the one instance for now.

matthewpwilson commented 4 years ago

@scottkurz please review

matthewpwilson commented 4 years ago

Thinking about this further I've realised my testing isn't sufficient to prove my fix does the job.... I'll close the PR for now until I've proved it

matthewpwilson commented 4 years ago

I believe this is fine - I tested by pushing my new stack image to Dockerhub, and changed my project's .appsody-config.yaml to point at it. If I understand correctly Appsody will pick up the new Dockerfile from the stack image and use that for appsody build. This works correctly with my fix in place.

scottkurz commented 4 years ago

@Kamran64 we can build this:

Fix docker bug hit during appsody build: failed to export image: failed to create image: failed to get layer

Thanks