Avatar
norio_nomura 8/9/2025 3:04 PM
CDIっていう仕組みを使って、docker build中にRosetta for LinuxのAOT Cachingを有効にできる事がわかった。 https://github.com/cncf-tags/container-device-interface/blob/main/SPEC.md
Contribute to cncf-tags/container-device-interface development by creating an account on GitHub.
😲 1
3:05 PM
CDIは元々コンテナビルド中にGPUなどを使うために作られたぽい。 https://docs.docker.com/build/building/cdi/
Using CDI to access GPUs and other devices in your builds
3:10 PM
RUN --device=lima.io/rosetta=enable-aot-caching ... みたいな記述をすることで、RUNの環境にホスト側で動くAOT Cachingを受け持つrosettad daemonが使うソケットをコンテナ内にbindマウントする様に構成できる。 すると、コンテナ内のrosettarosettadと通信できるようになり、AOT Cachingが動くようになる。 (edited)
3:14 PM
macOSのdarwin環境下のRosettaサポートが終わっても、Virtualization.frameworkでのRosetta for Linuxの提供は終わらないらしいから、この方法もまだ活用できるはず。 (edited)