How do I run the strawberry pie program on centos via docker?

  docker, question

I have some strawberry pie programs now, but I hope to run a test in centos and think of Docker when I use the real machine. I understand that docker is like a small operating system, through which code can run. Is my understanding biased? If not, how will it be done?

Before doing the above mentioned things, one thing needs to be clear, that is, CPU architecture.
The cpu architectures of PC systems and embedded systems are different, and you may need to understand the differences of CPU architectures such as i386, x86_64, arm32, arm64, armv7, armv8(aarch32, aarch64)

Obviously, the strawberry pie belongs to an embedded system and uses arm architecture. the strawberry pie above 3 (including 3b and 3b+) can support 64-bit cpu, that is to say, it uses armv8 architecture. armv8 supports two attributes, namely, aarch32 and aarch64. in popular terms, the latest strawberry pie can already support 64-bit, while the previous version only supports 32-bit

If your docker is installed on a PC or in a virtual machine on a PC (such as a vm virtual machine), then the hardware used by docker shares the hardware core with the host computer. Therefore, the hardware core of the host computer determines the core of Docker, in other words, Docker is not a virtual machine, and cannot virtualize a set of hardware with different cpu architecture from the host computer. Even a vm virtual machine cannot run an arm version of the operating system.

Centos system can be installed in strawberry pie, and centos has img image officially, but it is only 32 bits.
Docker can be installed in centos system running in strawberry pie. It is worth noting that the official document of Docker points out that nesting Dockers is not recommended, that is, to create a centos mirror container in Docker and then install a Docker in this container. Although it is supported, it is not recommended to do so.

To realize the test environment as you mentioned, please refer to the following:
1. A real machine with the same cpu architecture as the strawberry pie, that is, a real test machine with arm architecture
2. Use qemu virtual machine. qemu is a software simulation environment that can simulate the operating system running arm architecture, but its performance is said to be worrying.
3. Cross-compiling environment is used, that is, Linux on pc has the ability to compile programs with different cpu architectures. After cross-compiling, programs can be transplanted to arm-based machines

If there are any biased or different plans mentioned above, I hope you will not hesitate to comment.