cesanta / mongoose-os

Mongoose OS - an IoT Firmware Development Framework. Supported microcontrollers: ESP32, ESP8266, CC3220, CC3200, STM32F4, STM32L4, STM32F7. Amazon AWS IoT, Microsoft Azure, Google IoT Core integrated. Code in C or JavaScript.
https://mongoose-os.com
Other
2.51k stars 429 forks source link

build esp32 images for both amd64 and arm64 #599

Closed nikwest closed 2 years ago

nikwest commented 2 years ago

This will build images for esp32 both for amd64 and arm64.

TODO:

nikwest commented 2 years ago

Yes, this seems to be like that. The registry is handling the multiarch images. Docker daemon doesn't know anything about it. I also was kind of surprised, see https://github.com/docker/buildx/issues/59.

If you want to load a freshly built image into docker directly you can use the --load command. But this only works for single arch images.

I think podman/buildah alternative doesnt have this restrictions like docker has. The only option I see for testing is to run a local registry container and push the images there. Looks straightforward but I haven't tried it. But I can look at it. Might be an useful addition.

pimvanpelt commented 2 years ago

Cool work, @nikwest, thanks for adding arm64 for Mongoose OS. I'm sure that the raspberry pi folks will appreciate it :-)

rojer commented 2 years ago

Yes, this seems to be like that. The only option I see for testing is to run a local registry container and push the images there.

what, what? this sucks. being able to iterate locally on images without uploading them is important - to me, personally :) can we have a special target that uses build and not buildx? build-local or whatever. or, if we set PLATFORMS = amd64, does it become a single-platform image and then we can --load?

nikwest commented 2 years ago

Yes, if you set PLATFORMS to a single arch then --load works.

nikwest commented 2 years ago

I also adapted things for the other device platforms:

rojer commented 2 years ago

ok, let's go with this. thanks!