-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Bug: dockerbuildargs doesn't work #5903
Comments
Hi there, I've tried to re-produce the issue but I was able to see the output during the build.
Resource definition;
If I run
If I re-run this without changing anything, the lines where it outputs So you can do Please let us know if you have other questions. |
@mndeveci Thanks for the quick response. Yea, I've deleted the image and reran the build. It seems like the order of # doesn't work as expected
ARG MY_VAR
FROM public.ecr.aws/lambda/python:3.10
RUN echo $MY_VAR # works as expected
FROM public.ecr.aws/lambda/python:3.10
ARG MY_VAR
RUN echo $MY_VAR |
On side note: how would I specify dynamic build args for a production env vs. a development env? My use case is I have a local image for my layers and I want to use that vs. the one in ECR for example. So something like: FROM ${IMAGE_LOCATION} as layers
... But that means I have to define a |
I don't know about the order of For making it dynamic, you can use
And you need to provide value for
|
I am resolving this issue now but please don't hesitate to ask any questions you might have. |
|
Description:
I'm building my lambda function using docker and the
Metadata.DockerBuildArgs
aren't accessible in the dockerfile.Steps to reproduce:
template.yaml
functions/my_function/Dockerfile
sam build
Observed result:
Expected result:
Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
sam --version
: 1.86.1The text was updated successfully, but these errors were encountered: