256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
|
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
|
-
+
|
That should yield “`armv7l`”, an entirely different CPU architecture from your host. Even if you try this on an ARM64 host (e.g. an Apple Silicon macOS box) you still need transparent CPU emulation to cope with the different machine word size.
For that to work under `container.npk`, the RouterOS developers would have to do the same thing Docker and Podman do: ship the QEMU and Linux kernel [`binfmt_misc`](https://en.wikipedia.org/wiki/Binfmt_misc) bridges needed to get the OS to accept these “foreign” binaries. Since it would approximately double the size of RouterOS to do this for all the popular CPU architectures, they naturally chose _not_ to do this.
What this means in practice is that you have to be sure the images you want to use were built for the CPU type in your RouterOS device.
<a id="qemu"></a>There is a path around this obstacle: ship your own CPU emulation, as was done in [this forum thread](https://forum.mikrotik.com/viewtopic.php?t=189485), which describes a container that bundles the 32-bit Intel-compiled `netinstall-cli` Linux binary along with an ARM build of of `qemu-i386` so that it will run on ARM RouterOS boxes. For a process that isn’t CPU-bound — and NetInstall is very much I/O-bound — this can be a reasonable solution as long as you’re willing to pay the ~4 megs the emulator takes up.
<a id="qemu"></a>There is a path around this obstacle: ship your own CPU emulation, as was done in [this forum thread](https://forum.mikrotik.com/t/guide-running-netinstall-server-on-a-tik/161056), which describes a container that bundles the 32-bit Intel-compiled `netinstall-cli` Linux binary along with an ARM build of of `qemu-i386` so that it will run on ARM RouterOS boxes. For a process that isn’t CPU-bound — and NetInstall is very much I/O-bound — this can be a reasonable solution as long as you’re willing to pay the ~4 megs the emulator takes up.
## <a id="compat"></a>Intel and ARM Only
If you [run the binfmt test image](https://github.com/tonistiigi/binfmt#build-test-image) under your container build system of choice,(^Simplest method: `docker run --privileged --rm tonistiigi/binfmt`) it is likely to list several CPU types besides Intel and ARM, but that only tells you which platforms you can build an image for, not which platforms your runner — `container.npk` in this case — will accept. The prior point about lack of CPU emulation means you must find exact matches in this list for the CPU type in your chosen RouterOS device.
MikroTik has shipped an awful lot of MIPS-based product over the years, and it continues to do so, most recently as of this writing in their [CRS518-16XS-2XQ-RM](https://mikrotik.com/product/crs518_16xs_2xq). Atop that, there are other CPU architectures in the historical mix like PowerPC and TILE. MikroTik doesn’t ship a `container.npk` for any of these platforms.
|