-
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
Elbe Docker container #407
base: master
Are you sure you want to change the base?
Conversation
Thanks for your contribution! Currently I have a few issues with the design of the PR.
In general it should be fine for |
Hi @t-8ch,
Yes, that's true and mainly results from the fact that elbe is at the moment expecting a not-documented environment. If elbe would be more flexible wrt this, it would help to make this more clean.
I built the container as a base for a VS Code dev container workspace for image and application development (see https://github.com/thir820/elbe_dev_container/tree/ebcl_1.1.1_no_vm ). This is a interactive use case, since this container also needs to provide all other tools necessary for the use-cases, as a pre-defined development environment. A non-interactive "CI" usage is also possible, but it's a secondary goal.
Yes, it breaks the bootstrapping. The container is not pre-built and delivered, but instead the container is built by the VS Code dev containers plugin by calling a build script (see https://github.com/thir820/elbe_dev_container/blob/ebcl_1.1.1_no_vm/.devcontainer/build_container.sh ). With this setup, I don't need to run a Docker registry and can built for the local environment (e.g. UID), to allow a seamless integration. The only requirement for the host is that Docker is available, and that the binfmt_misc kernel module is loaded if cross building is wanted.
soruce.xml is copied to /var/cache/elbe/, since the elbe service is expecting such a file and doesn't work properly without it. elbe.list is indeed not used anymore and can be removed. It would be needed if elbe is installed from the apt repo instead of using the sources. |
This commit adds a Docker container for elbe which supports building images without an initvm. It supports Debian and Ubuntu based images and can built with a Debian or and Ubuntu base. Building images for foreign architecutres is supported, if the binfmt_misc kernel module is loaded in the host environment. The command build_image is proided as helper for one-shot builds: Usage: build_image [ -c | --build-sdk ] [ -r | --result-path ] -i | --image path/to/image/xml Known issues: ------------- - The initvm command doesn't work - Building ISOs doesn't work Signed-off-by: Thomas Irgang (thir820) <[email protected]>
c0023ba
to
add55d7
Compare
FYI with the changes in https://lists.linutronix.de/pipermail/elbe-devel/2024-May/006954.html elbe should work completely without any virtualization extensions.
When building through elbe a registry would also not be necessary.
Ack. Some more questions: elbe.asc seems unneeded. What is the advantage of supporting multiple base operating systems? |
|
||
CONF_FILE=/usr/local/etc/binfmt.conf | ||
BASEDIR=/proc/sys/fs/binfmt_misc | ||
KERNEL=$(cat /proc/sys/kernel/osrelease) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused
@@ -0,0 +1,25 @@ | |||
#!/bin/bash | |||
|
|||
lsmod | grep binfmt_misc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This check will also fail if binfmt_misc is builtin.
Instead check for "binfmt_misc" in /proc/filesystems
/.
Or unconditionally call modprobe. It will helpfully do nothing if it's builtin.
@@ -0,0 +1,102 @@ | |||
#!/bin/bash | |||
|
|||
set +e |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This disables "abort on error", intentional?
If so, it needs an explanation.
echo "SCRIPT: $SCRIPT_DIR" | ||
cd $SCRIPT_DIR | ||
|
||
cd ../../ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use pushd
and popd
below. Or a subshell.
deb [arch=amd64] http://archive.ubuntu.com/ubuntu jammy-security main restricted universe multiverse | ||
deb-src [arch=amd64] http://archive.ubuntu.com/ubuntu jammy-security main restricted universe multiverse | ||
|
||
deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports jammy main restricted universe multiverse |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
arm64
is in the main Ubuntu archive, so I think the separation is not necessary.
http://archive.ubuntu.com/ubuntu/dists/lunar/Release
This commit adds a Docker container for elbe which supports building images without an initvm. It supports Debian and Ubuntu based images and can built with a Debian or and Ubuntu base. Building images for foreign architecutres is supported, if the binfmt_misc kernel module is loaded in the host environment.
The command build_image is proided as helper for one-shot builds:
Usage: build_image
[ -c | --build-sdk ]
[ -r | --result-path ]
-i | --image path/to/image/xml
Known issues: