[obs-commits] [openSUSE/obs-build] b7af38: Add initial support for building inside Docker con...
Branch: refs/heads/master Home: https://github.com/openSUSE/obs-build Commit: b7af38426f45b1fe6e09d170712c0b30c3b1b987 https://github.com/openSUSE/obs-build/commit/b7af38426f45b1fe6e09d170712c0b3... Author: Oleg Girko <ol@infoserver.lv> Date: 2015-03-25 (Wed, 25 Mar 2015) Changed paths: M build M build-vm A build-vm-docker Log Message: ----------- Add initial support for building inside Docker containers. This change adds support for building inside lightweight Docker containers. The following approach is used. * Minimal busybox pre-built image is used (downloaded from Docker Hub automatically on the first use). * Docker container is started from this image. * The container is configured with sys_admin capability granted to allow second stage to mount "/proc" and "/sys". * Build root is configured as a volume for this container, mounted at "/mnt" directory inside the container. * Second stage is started inside the container, chrooted in "/mnt" directory. This convoluted approach is used for the following reasons. * There's no way in Docker to mount container's root fs and populate it (as with KVM build). * You can only create containers from images, mount some host directories to container's directories upon container creation (no way to reconfigure these mounts later); all further changes to container's filesystem can be done only by running commands inside the container. * Mounting build root as container's root (as with LXC build) is impossible. There's empty pre-built image called scratch, but using it to create container with build root directory mounted on container's root doesn't work: scratch image can be used only as base for creating other images, but not containers; also, it's not allowed to mount host directories on container's root anyway. * It's also possible to create an image for each build, but it's too slow and space consuming: you have to populate build root, then use its tar archive to build a new container, and only after that create a container from this image and run second stage inside it. Also, retrieving build results from this container can be tricky. Using Docker's lightweight layered image features is an idea for further research. Signed-off-by: Oleg Girko <ol@infoserver.lv> Commit: a5c965fb4dbd02468331c9bf5f3bc0b343b2e186 https://github.com/openSUSE/obs-build/commit/a5c965fb4dbd02468331c9bf5f3bc0b... Author: Michael Schroeder <mls@suse.de> Date: 2015-04-09 (Thu, 09 Apr 2015) Changed paths: M build M build-vm A build-vm-docker Log Message: ----------- Merge pull request #163 from OlegGirko/support-docker Add initial support for building inside Docker containers. Compare: https://github.com/openSUSE/obs-build/compare/652e75538da7...a5c965fb4dbd
participants (1)
-
GitHub