-
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-cdk/aws-lambda-python-alpha: Docker build does not work with podman. #32092
Comments
From what I can tell this seems to be an issue with the core aws-cdk-lib code that is forcing a user parameter always. ( aws-cdk/packages/aws-cdk-lib/core/lib/private/asset-staging.ts Lines 29 to 42 in 6303b72
I hacked it up by creating a custom "docker" script in the path so cdk will use that instead. And the only thing the script does it remove the -u X parameter. |
@pahud Podman is an alternative to Docker that runs in user space vs as root. (more secure) So, finch does not come into play at all. the issue centers around aws-cdk-lib's assumption that it is using a ROOT docker and needs to force the container to run as the local user to map file permissions correctly. This is not the case with Podman. Podman
Thus having some detection of podman and adjusting some of the defaults to make it behave more friendly would make CDK even better. Another option would be to allow some kind of user-level configuration adjustments to default the behavior differently without having to modify the stack setup with local-environment related adjustments. I cannot (and will not) use Docker desktop on my mac, as the licensing prohibits me from using it without paying for a license for commercial use (see license info). |
Describe the bug
When the aws-cdk.lambda-python-alpha package uses a container to package up a layer it passes in parameters that are not needed with podman (due to it running as the user).
Thus the CLI that is generated when prepping a layer looks like this.
However, the user mapping
-u 501:20
causes issues with podman and causes permission denied errors for the script.Removing that mapping allows the script to work.
Further when running in that mode the output folder (
asset.2b2e755e90bc7b0c887c1688b8b6d93ed65c286ed49bca0f6425b999735a9b09
) does not need to be world writable (777).Related #31319
Regression Issue
Last Known Working CDK Version
No response
Expected Behavior
The CDK process works. (and podman is becoming more common especially with the unfriendly licenses of Docker Desktop)
Current Behavior
Error from the rsync command when running with -u "501:20"
Reproduction Steps
PythonLayerVersion(
self,
'CustomLayer',
entry=scriptPath('src/layer'),
compatible_runtimes=[_lambda.Runtime.PYTHON_3_11],
)
Possible Solution
Allow for specifying/detecting
podman
vsdocker
so differing behaviors can be appliedAdditional Information/Context
No response
CDK CLI Version
2.166.0
Framework Version
No response
Node.js Version
18.16.1
OS
macOS 12.7.6
Language
Python
Language Version
3.11
Other information
No response
The text was updated successfully, but these errors were encountered: