Skip to content

Enable BuildKit in ImageBuilder#1132

Merged
lbussell merged 3 commits intodotnet:mainfrom
lbussell:enable-buildkit
Apr 19, 2023
Merged

Enable BuildKit in ImageBuilder#1132
lbussell merged 3 commits intodotnet:mainfrom
lbussell:enable-buildkit

Conversation

@lbussell
Copy link
Member

@lbussell lbussell commented Apr 18, 2023

This is needed to facilitate dotnet/dotnet-docker#4447 and dotnet/dotnet-docker#4542

@ghost ghost added the untriaged label Apr 18, 2023
@ghost
Copy link

ghost commented Apr 18, 2023

I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label.

@lbussell lbussell merged commit c58e0cf into dotnet:main Apr 19, 2023
@mthalman
Copy link
Member

mthalman commented May 8, 2023

I'm concerned that this may have affected the metadata of the outputted image. It doesn't look like the architecture variant is getting set for the built image (specific to Arm). This build result is an example of the issue.

Unhandled exception: System.InvalidOperationException: Platform 'Dockerfile.az.linux' is configured with an architecture that is not compatible with the base image 'mcr.microsoft.com/dotnet-buildtools/image-builder:linux-arm64':
Manifest platform:
	Architecture: ARM64
	Variant: v8
Base image:
	Architecture: ARM64
	Variant: 

@lbussell - Can you investigate this?

@lbussell
Copy link
Member Author

lbussell commented May 9, 2023

Couple findings -

  1. I tried building an arm64 image on my Windows machine with Docker Desktop which has buildkit enabled by default. Produced an arm64v8 image from mcr.microsoft.com/dotnet/runtime-deps:7.0-alpine3.17-arm64v8 and it kept the v8 in the variant. I checked by running docker inspect -f "{{ .Architecture }}/{{ .Variant }}" $image like the pipeline.
  2. I pulled the offending arm64v8 ImageBuilder from the dotnetdocker ACR staging location and it still had the correct variant. I pulled the exact ImageBuilder tag (mcr.microsoft.com/dotnet-buildtools/image-builder:linux-arm64-2174742) and verified it still had the correct v8 variant. Thinking about it more this is expected, because when we use the new ImageBuilder to produce itself, it drops the v8 variant off of the new image. The existing images have the correct variant or else they wouldn't have made it through CI.

I also retried failed jobs on that pipeline and it still had the same error. This feels like a bug somewhere in ImageBuilder and requires more investigation, so for now I have prepared a PR that reverts the BuildKit changes: #1136

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants