Description
This is a little bit suspect, since I have my own overrides of PublishContainer to work around #36651. However, I do still think it's some bug somewhere.
During an individual build on my CI, a zero-length .tar file was produced by containerize.dll, and the project continued executing to completion without failure. Upon examine the logs, I see:
PublishContainer:
Creating directory "bin\Release\net6.0\linux-x64\container".
"C:\hostedtoolcache\windows\dotnet\dotnet.exe" "C:\hostedtoolcache\windows\dotnet\sdk\8.0.100\Containers\build\..\containerize\containerize.dll" "bin\Release\net6.0\linux-x64\publish" --baseregistry "mcr.microsoft.com" --baseimagename "dotnet/runtime-deps" --repository "asdasd" --workingdirectory "/app" --baseimagetag "6.0-jammy" --appcommand "/app/asdasd" "dotnet" "asdasd.dll" --labels "application=asdasd" "version=23.12.45" "org.opencontainers.image.created=2023-12-08T12:11:53.3748345Z" "org.opencontainers.artifact.created=2023-12-08T12:11:53.3748345Z" "org.opencontainers.image.authors=asdasd" "org.opencontainers.image.version=23.12.45" "org.opencontainers.image.base.name=mcr.microsoft.com/dotnet/runtime-deps:6.0-jammy" --imagetags "23.12.45" --rid linux-x64 --ridgraphpath "C:\hostedtoolcache\windows\dotnet\sdk\8.0.100\RuntimeIdentifierGraph.json" --archiveoutputpath "bin\Release\net6.0\linux-x64\\container\asdasd.tar"
"C:\hostedtoolcache\windows\dotnet\dotnet.exe" "C:\hostedtoolcache\windows\dotnet\sdk\8.0.100\Containers\build\..\containerize\containerize.dll" "bin\Release\net6.0\linux-x64\publish" --baseregistry "mcr.microsoft.com" --baseimagename "dotnet/runtime-deps" --repository "asdasdasd" --workingdirectory "/app" --baseimagetag "6.0-jammy" --appcommand "/app/asdasdsd" "dotnet" "asdasd.dll" --labels "application=asdasd" "version=23.12.45" "org.opencontainers.image.created=2023-12-08T12:11:53.3748345Z" "org.opencontainers.artifact.created=2023-12-08T12:11:53.3748345Z" "org.opencontainers.image.authors=asdasdasd" "org.opencontainers.image.version=23.12.45" "org.opencontainers.image.base.name=mcr.microsoft.com/dotnet/runtime-deps:6.0-jammy" --imagetags "23.12.45" --rid linux-x64 --ridgraphpath "C:\hostedtoolcache\windows\dotnet\sdk\8.0.100\RuntimeIdentifierGraph.json" --archiveoutputpath "bin\Release\net6.0\linux-x64\\container\asdasd.tar"
info: Containerize[0]
Building image 'asdasd' with tags 'asdasd' on top of base image 'mcr.microsoft.com/dotnet/runtime-deps:6.0-jammy'.
fail: Containerize[0]
CONTAINER1013: Failed to push to the output registry: Containerize: error CONTAINER004: CONTAINER1014: Manifest pull failed.
URI: https://mcr.microsoft.com/v2/dotnet/runtime-deps/blobs/sha256:5e8117c0bd28aecad06f7e76d4d3b64734d59c1a0a44541d18060cd8fba30c50
I think it was a transient failure with either the mcr.microsoft.com repository, or the network itself. Unsure. I haven't been able to reproduce it. However, the build continued, so I believe containerize.dll errored, produced an empty tar, but returned exit code 0. The problem is it probably should not have returned exit code 0. I assume this could make the code in the normal path (without myoverridden targets) fail similarily.