Open NickDarvey opened 3 years ago
Not sure if this is feasible and how the image tag could be specified in the serverless.template
. Needs more investigation.
I'm not sure I understand. Right now, by default, here's a name:tag
combo being generated from the project name and used for the Docker image build and push. You can already manually set it using aws-lambda-tools-defaults.json
, this feature is a request to an option to specify it via a command line parameter.
We have noticed this issue has not received attention in 1 year. We will close this issue for now. If you think this is in error, please feel free to comment and reopen the issue.
Because the package-ci
command is potentially packaging multiple .NET projects that referenced in the CloudFormation template you need to set the image tag in there as well. If we had an --image-tag
switch for for the package-ci
command it would use the same tag for all of the containers being built from the CloudFormation template overwriting each other. Here is an example of how to set the image tag in the template.
This issue has not received a response in 5 days. If you want to keep this issue open, please just leave a comment below and auto-close will be canceled.
@normj
If we had an --image-tag switch for for the package-ci command it would use the same tag for all of the containers being built from the CloudFormation template overwriting each other.
Is that what happens when you set it via aws-lambda-tools.defaults.json
? Maybe the tool should error if it’s used with multiple projects when an image tag is set. Then an image tag switch could be added which would, similarly, error if used with multiple projects.
@NickDarvey Interesting the image-tag
being used from aws-lambda-tools.defaults.json
is actually an accidental side effect since the package-ci
command eventually forwards into the package
command's code for each project it is bundling into an image. Although that image-tag
isn't being used solely, the package-ci
command does inject the CloudFormation resource name into the image tag to make it unique. Are you okay with the tag not being exactly as you entered. I guess what I'm asking is would you be okay if we exposed an image tag prefix/suffix switch but we still used our code to make sure the full tag name is unique?
Interesting the image-tag being used from aws-lambda-tools.defaults.json is actually an accidental side effect since the package-ci command eventually forwards into the package command's code for each project it is bundling into an image.
Ahh I see.
I guess what I'm asking is would you be okay if we exposed an image tag prefix/suffix switch but we still used our code to make sure the full tag name is unique?
That would work for me :)
-it | --image-tag
looks like it is supported inpackage
but notpackage-ci
. Is this as designed?https://github.com/aws/aws-extensions-for-dotnet-cli/blob/9639f8f4902349d289491b290979a3a1671cc0a5/src/Amazon.Lambda.Tools/Commands/PackageCommand.cs#L31
https://github.com/aws/aws-extensions-for-dotnet-cli/blob/9639f8f4902349d289491b290979a3a1671cc0a5/src/Amazon.Lambda.Tools/Commands/PackageCICommand.cs#L26-L37
Describe the Feature
Allowing users to specify the tag for my Docker image using the
--image-tag
switch.Is your Feature Request related to a problem?
The generated image tag (taken from the project name) might not be the one that's desired.
Proposed Solution
Unsure. Is this code base up to date with what is published as a dotnet tool?
Describe alternatives you've considered
Accepting life as-is. Edit: It appears to work when set in
aws-lambda-tools.defaults.json
.Additional Context
Environment
This is a :rocket: Feature Request