Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A bit more help #1

Open
svrooij opened this issue Dec 27, 2019 · 3 comments
Open

A bit more help #1

svrooij opened this issue Dec 27, 2019 · 3 comments

Comments

@svrooij
Copy link

svrooij commented Dec 27, 2019

Hi @rcarmo

I really like the idea of this Makefile that simplifies the build of a multi architecture docker image, and I have the perfect candidate. sonos2mqtt should be perfectly capable to be runned on some arm device. The base image however node:lts-alpine is already multi architecture, would that make any difference in building this app for multiple architectures?

If I would understand the process i would be willing to create some more documentation about this process.

@rcarmo
Copy link
Owner

rcarmo commented Dec 27, 2019

It shouldn’t be a problem, and should even simplify the bits where I explicitly tag the images with the target architecture - I do that out of habit from the pre-manifest days and also because I sometimes want to have extra architectures on the side, and it’s entirely optional.

What bits do you need help with? We can use this issue to discuss that.

@svrooij
Copy link
Author

svrooij commented Dec 27, 2019

I have no clue where to start. Probably need the following information:

  • Base image: node:lts-alpine = multi architecture
  • Working docker file: Dockerfile

And what I need to do is create the correct makefile (and optionally schedule it on some azure pipeline).

But I don't really understand what's happening in the makefile. What's that qemu I'm seeing everywhere.

To my understanding this is what get executed for each arch

  • make qemu
  • make wrap-$(ARCH)
  • make build-$(ARCH)
  • make push-$(ARCH)

And then make manifest to publish

@rcarmo
Copy link
Owner

rcarmo commented Jan 2, 2020

Hello there,

What the qemu step does is register QEMU on the current system to allow ARM binaries to be run inside an Intel host. This is because most public CI services only have x64 workers.

The wrap step builds a temporary container with the base image and a static qemu binary inside it, which acts as a base container for the build step. The added file is only a few megabytes (and can be removed later, although I don't bother), but is required for the ARM binaries to work inside the build step.

The rest should be straightforward, although I do use make recursively to set a few environment variables (it's easier to maintain than adding a bunch of external 5-line shell scripts).

Hope this helps (and Happy 2020!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants