Guest User

Untitled

a guest
Sep 3rd, 2018
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.35 KB | None | 0 0
  1. Situation
  2.  
  3. I have an application with architecture==armv7hf (ie, 32-bit with an FPU), containing one device (a raspberry pi 3b+, which supports both 32-bit armv7hf and 64-bit arm64), and a Dockerfile that says in relevant part:
  4.  
  5. services:
  6. postgres:
  7. image: postgres:9
  8.  
  9. Note that, as far as I can tell from:
  10. https://hub.docker.com/_/postgres/
  11. ... this 'postgres' image is a multi-architecture image that supports arm32 v7, although this is not explicitly stated anywhere that I can find.
  12.  
  13. What I would like to happen is
  14.  
  15. - The build tool (Balena, Docker [Compose], the resin.io builder, or whatever else reads this docker-compose file) shall determine the target platform (in this case, the resin.io builder shall see that the application's architecture is set to armv7hf)
  16. - The build tool shall build images that are compatible with the target architecture.
  17.  
  18. What actually happens is
  19.  
  20. - The resin.io builder produces images containing arm64 binaries, even when targeting an application with architecture 'armv7hf'
  21. - The image download wizard thingy in the resin.io console spits out a 32-bit armv7hf ResinOS image when you add a 'raspberry pi 3' device to your project
  22. - As a result, when the device downloads and attempts to run the newly-built containers, it attempts to run 64-bit ARM binaries on a 32-bit ARM kernel running on 64-bit-capable ARM hardware, which can never work
  23. - So containers restart continually and spam the logs with 'exec format error'
  24.  
  25. I don't understand why the resin.io builder is producing arm64 binaries. This appears to me to be a bug, as I did not specify 'arm64' as the target platform for my application (I don't even know of a way to do that).
  26.  
  27. Questions
  28.  
  29. - Is there a way to force the resin.io builders to build a certain architecture to work around this?
  30. - Alternatively, if there's no way to force the resin.io builder to use the correct architecture, then can I build images locally instead, thus disusing the resin.io builder? (My assumption here is that Docker will choose the correct architecture).
  31. - Alternatively, is there an arm64 build of ResinOS? Migrating both the kernel and userspace to 64-bit on this dual-arch-capable hardware would also be a workaround.
  32. - Is this simply due to the following TODO item?
  33. https://github.com/resin-os/balena-containerd/blob/036232856fb8f088a844b22f3330bcddb5d44c0a/image.go#L80
Advertisement
Add Comment
Please, Sign In to add comment