-
Notifications
You must be signed in to change notification settings - Fork 39
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
ContainerImageTags doesn't work #236
Comments
Good catch - it looks like we have some kind of unhandled crash here. We need to have at least some kind of.output when this occurs, in addition to fixing the underlying multiple-tags issue. |
Thanks for the report @flcdrg! You can work around this in your project: <ItemGroup>
<!-- Work around https://github.com/dotnet/sdk-container-builds/issues/236 -->
<ContainerImageTags Include="$(ContainerImageTags)" />
</ItemGroup> That shouldn't be required, though! |
The silent failure is because there is nothing in this foreach:
So we just don't attempt any push. We should probably error if |
But why is it empty? It's getting lost somewhere in
... oh
|
A logic error caused ParseContainerProperties to fail if multi-valued tags were passed into ContainerImageTags. A test error made that non- obvious. Fix the tests to use CollectionAssert methods, and invert the check on TryValidateTags so that when the tags are valid we respect them. Fixes dotnet#236.
I think #239 will do the trick but haven't validated the full scenario yet. |
A logic error caused ParseContainerProperties to fail if multi-valued tags were passed into ContainerImageTags. A test error made that non- obvious. Fix the tests to use CollectionAssert methods, and invert the check on TryValidateTags so that when the tags are valid we respect them. Fixes #236.
@flcdrg I confirmed that prerelease package ❯ dotnet publish --os linux --arch x64 -c release -p:PublishProfile=DefaultContainer -nr:false
MSBuild version 17.4.0+18d5aef85 for .NET
Determining projects to restore...
All projects are up-to-date for restore.
236 -> S:\repro\dotnet\sdk-container-builds\issues\236\bin\release\net7.0\linux-x64\236.dll
236 -> S:\repro\dotnet\sdk-container-builds\issues\236\bin\release\net7.0\linux-x64\publish\
Building image '236' with tags 1.2.3-alpha2,latest on top of base image mcr.microsoft.com/dotnet/aspnet:7.0
Pushed container '236:1.2.3-alpha2' to Docker daemon
Pushed container '236:latest' to Docker daemon |
Adding
ContainerImageTags
to a csproj doesn't work.. eg.Edit .csproj and add
<ContainerImageTags>1.2.3-alpha2;latest</ContainerImageTags>
to the firstPropertyGroup
The following output is produced:
Note that no tags are listed in the output.
Checking Docker and there are no new images published.
I can confirm that
ContainerImageTag
(without the 's') does workThe text was updated successfully, but these errors were encountered: