-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Instructions to use sdm inside a Docker container #281
base: master
Are you sure you want to change the base?
Conversation
Thank you🙏Will have a look! |
If you are new to docker, https://docs.docker.com/engine/install/debian/ has the instructions to get the 'hello-world' example running. |
I must be dumb today. I set up a new system, installed docker, set up the working directory, and ran the file: sudo docker run --privileged --network host --rm \
-v "$(pwd)/myscript.sh:/myscript.sh" \
-v "$(pwd)/working_dir:/root/sdm_working_dir" \
--device=/dev/loop-control \
--device=/dev/loop0 \
debian:latest bash /myscript.sh which gave the following output:
My questions:
Thx! |
Indeed, myscript.sh should be a file, not a directory. See lines 13 to 38 of the as to what could/should be in that file.
Yes. It takes a directory from the host, and makes its content (here: the to be customized image) available to the docker container. Also, when the container writes into this directory (here: the burned image file), the content becomes available on the host.
It makes a device from the host (here: the loop device and its control) available to the container. So when the container calls
|
Indeed, when everything is set up properly (which I would have done first go if I had read your notes a bit more carefully 🫤) it works. So far, the only thing I see that I don't care for is that each time I do the Thx! |
Let me know where the language or format could be clearer.
Yes, that is possible. However (a) the majority of the runtime is spent in qemu doing an Therefore I didn't bother. If you care strongly about this, I'll add the instructions, but I think it is not worth it. |
If anyone tries to use this at the far end of a slow internet connection, they will be unhappy. I would like to see how to do it statefully as well, as an alternative. Thx! |
To do this in a stateful manner, it is possible to split the
However, I'm not convinced this is worth it. The user might forget to run the |
Thx. Will have another look at this when I'm free in about 2 weeks. |
I've run into an issue in working through this. Pretty sure I didn't see this before, but now I am, and I'm stuck. dodocker
myscript.sh
I mounted a customized IMG on /mnt/sdm elsewhere before running dodocker. Here's the abbreviated output:
Primary issue is the 'failed to open system bus'. The 'attempted to remove disk' error is probably due to the hokie way I have it mounted, so not an issue (yet 🫤) Thx for your assistance! |
Looks to me like you try to use systemd-nspawn inside of the docker container. I'm not sure that is supported. Qemu does work, though. |
I narrowed down to this test because using sdm per your instructions was getting the error I noted. But you didn't specify using |
This is working for me on Windows:
|
@omya3qno Is it possible to use this approach when building docker image? I have not found how can I attach loop device while building. |
For my CI-execution scenario, this approach couldn’t work because it assumes mapping |
No description provided.