-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
(aws-lambda-python) docker build is not working #12610
Comments
|
It seems I managed to reproduce it again. I added a line that prints out the docker command, and run it manually. It seems the the This works:
But this fails:
This is on ArchLinux with docker:
|
It seems the issue is that the root (/) is not accessible to anyone other than root (uid 0):
I tried adding a
Any idea how I could work around the issue? |
I noticed that the reference issue #10881 fixed this by adding |
It seems that the above behavior where the root mode can't be changed is only when using the btrfs storage driver. As a workaround, I switched to overlay2. Now I'm curious what should be done to fix this: |
I searched to location that build |
Hey @ncaq 👋🏻 Thanks for bringing this bug to our attention! I'm going to leave this issue as p1 because the potential impact of this is significant. The fix suggested above looks like an appropriate way of fixing this. If anyone is interested in lending a hand this is a great first issue to tackle. A good place to start is by following the steps described in our contribution guidelines. |
@ryparker Could you clarify which fix you are referring to?
If you are referring to this, could you please point my to the code that builds this image? IIRC from my research in February, the image is not built as part of any publicly available repository. |
I have the same problem. I'm using arch linux. The same build works fine on a Ubuntu vm. |
|
Thanks. In my case it was configured with "overlay", and i confirm that switching to "overlay2" fixed the problem. |
@ryparker Could you please clarify what fix you were referring to? It seems that's all that is standing in the way to get this fixed. |
Unfortunately, I'm facing the same issue with the ZFS storage driver. Is there any other workaround which doesn't involve changing my file system?
@ryparker I guess the same fix could be easily applied here as well. The only question is just the location of the Dockerfile:
I'd be happy to file a PR if someone could point me to the Dockerfile 😄 |
Yes, change the docker storage driver.
It doesn't seem to be public, so there is no way for us to make PRs. Someone from AWS needs to step up and fix this. It's a shame that @ryparker isn't responding to this anymore. The community did all the work and the root cause has been found. A fix has been suggested. All it needs is someone on the inside to apply the fix 😞 |
The overlay2 storage driver does not support all types of upper file systems (including mine). So unfortunately the workaround doesn't work for me. |
I apologize for the delay in response. I'm unable to reproduce this however I've applied the same fix that was applied to the nodejs image, to the python image. |
@ryparker Thanks for your reply. Here are the steps to reproduce the core issue:
It seems that with the
This might be a bug in the btrfs storage driver. But it could be fixed by creating the EDIT: I don't have ZFS, so I can't verify that, but it seems to suffer from the same issue. |
Unfortunately I can reproduce the issue with the steps described by @christophgysin with the ZFS storage driver. |
Thanks @christophgysin, I'm working on reproducing this on a fresh Linux machine. I'll hold the PR until we can confirm it fixes this. |
I was also able to reproduce this with the ZFS storage driver on Ubuntu 20.04:
Interestingly, switching to the
As a test, I tried applying the changes in https://github.com/aws/aws-cdk/blob/master/packages/%40aws-cdk/aws-lambda-nodejs/lib/Dockerfile#L31 (
This still fails, so I don't think just adding the user is going to fix this. |
Because in the btrfs and zfs storage drivers it is not possible to change the mode of the root directory in a layer, the PR won't fix this for those storage drivers. The only ways to fix this is to either fix the mode of the root in the initial layer, or change the btrfs and xfs (and possibly other) storage drivers to allow overriding the root mode in a layer. |
@ncaq @christophgysin @alexrashed new lambda.PythonFunction(this, 'function', {
entry,
runtime: Runtime.PYTHON_3_8,
bundling: {
image: DockerImage.fromBuild('/path/to/dockerfile'),
// or DockerImage.fromRegistry('...'),
},
}); |
@corymhall Without trying, I'm sure that this works, as the bug is in the docker image used by default. While this provides a workaround, is there something preventing us from fixing the official docker images? |
@christophgysin the official docker images are maintained by the |
@corymhall As I commented previously, that repo does not seem to contain the root image though, see e.g. https://github.com/aws/aws-sam-build-images/blob/develop/build-image-src/Dockerfile-python39#L2 It seems the root image that contains the bug is not built from any publicly available source. Any chance you could find out what team at AWS is responsible for that image and get their attention to this issue? |
@christophgysin I've created an issue so we'll see what they will say. |
Same problem happens when building
Changing default |
Thank you. It worked for me! Before, I was using the |
Closing this issue, as there is no action that can be taken in the AWS CDK. Internal ref: V783772357 |
|
Maybe the problem is
[aws-lambda-nodejs] docker build is not working · Issue #10881 · aws/aws-cdk
Python version.
Reproduction Steps
cdk deploy FooStack
What did you expect to happen?
What actually happened?
deploy is successed.
Environment
Other
This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered: