I develop for an embedded device and I would like to emulate this device in a docker container with the purpose to automate upgrade testing. The device contains the bootloader (u-boot), two root partitions and a data partition. During the upgrade process any partition may be touched. I have old SD card images we use in manufacturing that are copied to flash memory on the device. The image is a linux image built for an imx6 processor using yocto.
- Is it possible to make a container image from one of these images? If so how?
- Can a container image have multiple partitions? Or should I rethink this process?
I tried this
FROM scratch ADD my_sd_card.img /
When I started the image I got
Error response from daemon: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: "--attach": executable file not found in $PATH: unknown Error: failed to start containers: 3ff71505c5e9
A container image is just a collection of files; it doesn't have partitions because it's not a block device. You could in theory unpack your
.imgfile and make build a container image from that.E.g:
Mount the sd card image on a local directory
Create a Dockerfile that looks like:
Build the image:
That might work; it depends on what is installed in the image and how it operates.