How to import custom .iso/.img with docker?

I managed to create a project using BeagleBone to be able to receive and send messages from it and now I was thinking of expanding on it. However, it would involve getting another BeagleBone to be able to test it in my expanded project.

So I thought of testing my project virtually where I like to add an .exe file and let it simulate virtually instead of buying another BeagleBone. The image that I am using is

BeagleBone Image

How can I implement importing and running the docker image using the Beaglebone image from the link?

If not, is there a package in HUB that I can install that would have the sudo reboot function?

Thank you @patrick521 for your reply and detailed explanation.

Just a question, with the link that I shared in this post is it possible to import the .img (or .iso after conversion) into the docker file?

Beagle Bone Image

Related to Import custom ISO and alternative approach to sudo reboot function in Docker image

Note that the last response seems to contain AI, so take it with a grain of salt, it might not work 100%.

As discussed before, the ISO/img file usually contains a whole OS, you can’t simpl run that in Docker, which is used for processes, as @meyay phrased it.

You can mount an ISO on host to extract the files. But if there are applications included, they might not run in your Docker container. Usually Docker is running Linux apps, but it seems you want to run a Windows .exe.

What’s the reason to want to force a VM image into a Docker container? Why not use a simple VM like (free) VirtualBox?

Thank you for your reply @bluepuma77 .

Well, I wanted to use the same VM image instead of starting from scratch. But, I managed to sort this one out. I am now using for beaglebone as my base.

I just have two questions.

  1. Is it possible to have sudo reboot to be included in an image?
  2. Is it possible to import gpio into the image? [I know it is virtual container and it would not need to have gpio but in code that I made using beaglebone I am using gpio pins]

Also, can you provide me with an approach to save a docker image like in the following situation? because I looked and saw that I need to commit first the container with the updated image. Then, you save image as .tar file and then you load the image into docker so it can be used again if needed?

Say I started my docker container, compiled my code inside a docker image and managed to create an exe file.

You probably don’t want a sudo reboot in a container. It’s just a process, so it would theoretically reboot the whole machine.

Instead you just need to exit or terminate the process inside the container. When the container is configured accordingly, it will just be restarted.

Usually containers are used as is, you rarely save and restore containers. Instead you create the image with all files, store configs and new/changed files in a volume or a bind mount on host.

I am still not sure that containers are the right tool for your use case.

And it was written only to share a spam link in its quote replacing the original link so I deleted the message.

Thank you for your explanation. I have another question, is it possible to add like gpio library into an image? (Say I want to simulate what would happen if the value in pin became like 1 or 0; I know it is not possible as it is virtual but I am thinking of finding a way to write to a pin if a conditional statement became true)

Furthermore, I have been having issues using an existing image I created locally for another image. Say, I generate a core image and would like to use it in a Dockerfile for another image. I keep on getting this error,

[+] Building 0.0s (0/0)  docker:default
[+] Building 1.4s (3/3) FINISHED                                                                                                                                                                                              docker:default
 => [internal] load build definition from Dockerfile                                                                                                                                                                                    0.1s
 => => transferring dockerfile: 277B                                                                                                                                                                                                    0.0s
 => ERROR [internal] load metadata for                                                                                                                                                                1.1s
 => [auth] library/core_image:pull token for                                                                                                                                                                         0.0s
 > [internal] load metadata for
   1 |     # # Stage 1: Get the Core image:
   2 | >>> FROM core_image:latest
   3 |
   4 |     # Copy file to /home folder in the image
ERROR: failed to solve: core_image:latest: failed to resolve source metadata for pull access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed

I have checked the docker images and I could find created image in the repository:

REPOSITORY                        TAG        IMAGE ID       CREATED          SIZE
core_image                          latest     8f49402ceb3d   47 minutes ago   992MB

and I used this the following command to build the main image:

docker build -t main_image .

Please, try not to ask multiple questions in a single topic. The title describes the question. If you want people to find your questions and open the topic knowing they can answer it, open a new topic for unrelated questions. Thank you!

Apologies for multiple questions. I am just new to Docker and just struggling to wrap my head around the Docker Desktop in Windows while trying to set it to work with my project