Creating custom base images

Hey Michael,

  1. All resin-base images have a qemu binary which allows them to run on any host that has binfmt_misc setup and docker for mac does. binfmt_misc intercepts system calls to the kernal and uses qemu to emulate.

  2. I’ve only ever built custom images locally, but it is possible to build them on CI servers if you use a resin image as a base, this is because there is a tool called Resin-xbuild it’s a script that replicates what binfmt_misc does without having to touch the host system - more info here. You do however need to tell the tool which calls to intercept.

RUN [ "cross-build-start" ]
RUN apt-get install ...
RUN [ "cross-build-end" ]

Example here.

https://hub.docker.com/r/resin/raspberrypi3-debian/ is built on a custom CI server, so as far as I know we don’t need this tool, @nghiant2710 could you confirm?

  1. We currently don’t support build environment variables so there is no way to keep secrets in your build atm. A good work around is to build the image locally with our cli.
    The two commands you’ll need are:

This is a little out of my wheel house so I’ll have to ask @nghiant2710 our base image expert to make sure everything I’ve said is up to date and accurate. I hope that explains things a little.

2 Likes