EvilFreelancer/docker-routeros

This vs. VM

mhkarimi1383 opened this issue · 8 comments

I want to see this image is more efficient or Virtual machine
Because you are using qemu inside alphine

Hello! Unfortunately it is not simple extract RouterOS and pack to Docker image directly (without virtual machine level), I've tried many different ways, and qemu based solution was the most optimal for achieving the goal. But a lot of time has passed since then, perhaps more convenient tools have appeared for solving such problems. Maybe you can suggest more optimal solution?

I think If you have microtik you can just get it's rootfs (like other OSes) and put it in a tarball and using ADD in docker you can extract it into / and just use CMD ["/bin/sh"]
like here for alphine https://github.com/alpinelinux/docker-alpine/tree/v3.13/x86_64

Yes, it is possible, but problem is that it won't work and when you try to run such a Docker image, you will get a kernel panic of your host machine. By the way, you don't need to have a router at hand, just unpack the operating system from archive image or VM image.

let me try it out :)

I did it but I got this error

ERROR: opening root device = Operation not permitted
ERROR: opening root device = Operation not permitted
ERROR: opening root device = Operation not permitted
ERROR: opening root device = Operation not permitted
ERROR: opening root device = Operation not permitted
ERROR: opening root device = Operation not permitted
ERROR: opening boot device = Operation not permitted
ioctl FIBMAP failed
ioctl FIBMAP failed
ioctl FIBMAP failed
ioctl FIBMAP failed
ioctl FIBMAP failed
ioctl FIBMAP failed

Here is my Dockerfile

FROM scratch
ADD . /
CMD ["/bin/milo"]

Yep, because RouterOS is not just a shell, it also a custom linux kernel with tons of patches related to Miktorik devices.

This is why i've choose the qemu based solution.

It will be better if we know what to run to make it working