convert raw to docker image

GOAL: convert mikrotik chr raw to docker image

STEPS:
-download chr raw image

wget https://download.mikrotik.com/routeros/7.2rc3/chr-7.2rc3.img.zip

unzip chr-7.2rc3.img.zip

guestfish-a chr-7.2rc3.img --ro

run
list-filesystems
/dev/sda1: ext2
/dev/sda2: ext3
mount /dev/sda2 /
tar-out / - | xz --best >> chr-7.2rc3.xz

cat chr-7.2rc3.xz | docker import - chr-7.2rc3

docker run -it chr-7.2rc3 bash

ASK:

  1. how to add /dev/sda1 as boot image in docker chr-7.2rc3 image

Docker does not boot anything. It takes an image and runs a command from it in a containerized way.
You would need a full- or paravirtualized hypervisor to boot CHR, as the CHR relies on the Kernel it comes with to perform many of the networking functions. Docker is OS-level virtualization and relies on the host system’s kernel rather than running another kernel virtually.