Skip to content
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]: Add support for Dockerfiles not named Dockerfile in DockerImageCode.fromImageAsset #27549

Closed
2 tasks
mainframenzo opened this issue Oct 15, 2023 · 3 comments
Labels
@aws-cdk/aws-lambda Related to AWS Lambda closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. feature-request A feature should be added or improved. p2 response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.

Comments

@mainframenzo
Copy link

mainframenzo commented Oct 15, 2023

Describe the feature

Lambda.DockerImageCode.fromImageAsset expects Docker image instructions files to be named "Dockerfile", and they might not be. Please consider adding support for Docker image instruction files not named "Dockerfile".

Use Case

I have a number of Dockerfiles in a single folder that do not work with Lambda.DockerImageCode.fromImageAsset because it expects Docker image instructions files to be named "Dockerfile". For example, given the list of Docker files below, if I specify Lambda.DockerImageCode.fromImageAsset(path.resolve(process.cwd(), '../build-utils/docker/dockerfile.lambda.backend')), the CDK errors with Cannot find file at <root-path>/build-utils/docker/dockerfile.lambda.backend/Dockerfile.

Docker files e.g.:

build-utils/docker
├── dockerfile.base
├── dockerfile.lambda.backend
├── dockerfile.lambda.backend.dockerignore
├── dockerfile.lambda.backend.handler.sh
├── dockerfile.lambda.dataset-to-sqlite-db
├── dockerfile.lambda.dataset-to-sqlite-db.dockerignore
├── dockerfile.lambda.dataset-to-sqlite-db.handler.sh
├── dockerfile.run
├── dockerfile.run.dockerignore
├── dockerfile.run.entrypoint.sh
└── lambda-docker-bootstrap.sh

Proposed Solution

No response

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

2.89.0 (build 2ad6683)

Environment details (OS name and version, etc.)

Mac Ventura 13.5.2

@mainframenzo mainframenzo added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Oct 15, 2023
@github-actions github-actions bot added the @aws-cdk/aws-lambda Related to AWS Lambda label Oct 15, 2023
@mainframenzo
Copy link
Author

Looks like this exists :)

@pahud
Copy link
Contributor

pahud commented Oct 17, 2023

I believe it should exist, no?

@pahud pahud added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. p2 and removed needs-triage This issue or PR still needs to be triaged. labels Oct 17, 2023
@github-actions
Copy link

This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

@github-actions github-actions bot added closing-soon This issue will automatically close in 4 days unless further comments are made. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels Oct 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-lambda Related to AWS Lambda closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. feature-request A feature should be added or improved. p2 response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
Projects
None yet
Development

No branches or pull requests

2 participants