sdk-container-builds
sdk-container-builds copied to clipboard
Consistently generating corrupt docker images when publishing to private artifactory registry
In a .NET 7 project with 7.0.302 SDK, I have the following:
<ContainerRegistry>artifactory.example.dev</ContainerRegistry>
<ContainerImageName>path/to/image/dev</ContainerImageName>
<ContainerImageTags>latest</ContainerImageTags>
When I publish this, it claims to have worked:
$ dotnet public -r linux-x64 --no-self-contained
# ... skipped for brevity ...
Pushed container 'path/to/image/dev:latest' to registry 'artifactory.example.dev'
However, the image is broken:
$ docker pull artifactory.example.dev/path/to/image/dev:latest
latest: Pulling from path/to/image/dev
9e3ea8720c6d: Already exists
2436f232d040: Already exists
9a2730c0a140: Already exists
6bb6cfc88137: Already exists
8bc8046fd854: Already exists
b0f18d7e9903: Verifying Checksum
filesystem layer verification failed for digest sha256:b0f18d7e99035101c6702b87cc0fa488193996e4c5c7a3cbe631faceca63520b
I tried docker system prune -af and rebuilding, deleting everything from artifactory and rebuilding, nothing worked.
The only thing that worked was to remove the ContainerRegistry and ContainerImageName, publish to local Docker Desktop, and then manually add the tag and push to the private registry. However, this is not a scalable approach.
What is actually going on here, and how can I debug/resolve?