aws / aws-nitro-enclaves-with-k8s

Tools and guides for using AWS Nitro Enclaves with Amazon EKS.
Apache License 2.0
32 stars 11 forks source link

Copy from full_image fails #27

Closed dzygann closed 1 year ago

dzygann commented 1 year ago

Hi,

I'm encountering an issue by running the enclavectl build --image hello command. The COPY --from=full_image/ne-deps / seems somehow broken. I could comment out the line and then the build finish successfully. If I can trust the comment it should only increase the image size. However, it would be nice to have a working solution, because I could run into the enclave memory size restriction and rebuild the project again.

Edit: To comment out the breaking line is not working. Trying to start the pod runs into the error /home/run.sh: line 9: nitro-cli: command not found, because nitro-cli is missing...

See the error in the output:

=> [full_image 4/5] RUN BINS="    /usr/bin/nitro-cli     /usr/bin/nitro-enclaves-allocator     /usr/bin/jq     " &&     for bin in $BINS; do         { echo "$bin"; ldd "$bin" | grep -Eo "/.*lib.*/[^ ]+";   0.6s
 => [full_image 5/5] RUN     mkdir -p /ne-deps/etc/nitro_enclaves &&     mkdir -p /ne-deps/run/nitro_enclaves &&     mkdir -p /ne-deps/var/log/nitro_enclaves &&     cp -rf /usr/share/nitro_enclaves/ /ne-de  0.7s
 => ERROR [image 2/4] COPY --from=full_image /ne-deps /                                                                                                                                                        0.0s
------
 > [image 2/4] COPY --from=full_image /ne-deps /:
------
Dockerfile:44
--------------------
  42 |     # to shrink the final image size.
  43 |     #
  44 | >>> COPY --from=full_image /ne-deps /
  45 |
  46 |     COPY bin/hello.eif /home
--------------------
error: failed to solve: cannot copy to non-directory: /var/lib/docker/overlay2/kxizubh9pnidd15bk6eltw59e/merged/lib64
[enclavectl] Error while building docker image! (Code: 1)
[enclavectl] Cannot build docker image for hello!
meerd commented 1 year ago

Thank you for bringing this up @dzygann! The PR #26 has been merged.

berry2012 commented 2 weeks ago

Issue still happening even with amazonlinux:2