ocurrent / obuilder

Experimental "docker build" alternative using btrfs/zfs snapshots
Apache License 2.0
60 stars 17 forks source link

Docker backend #75

Closed MisterDA closed 2 years ago

MisterDA commented 3 years ago

This PR implements the Docker backend for OBuilder. It should support running on Windows with Docker for Windows, and on Linux with the usual Docker. This PR contains a batch of prerequisites, and then the backend. I have tested it on Windows and Linux, on basic examples.

talex5 commented 3 years ago

Thinking on about this... the Build module creates a builder from a store and a sandbox. That will work on Linux (runc+btrfs), mac (users+zfs) and probably on FreeBSD (jails+zfs). But it doesn't work with Docker, because Docker already combines a store and a sandbox. So probably this should be an alternative to the build.ml module instead.

MisterDA commented 3 years ago

Thanks for the review, I agree with your conclusion and will refactor the code to merge the Docker sandbox, Docker_storage, the Docker-related code in build.ml, and maybe the code to talk to the client in the Docker module into a single Docker_build module.

A note regarding the use of the Docker Engine API: I wanted to replace the process calls to the docker client with the Docker Engine API, talking directly to dockerd with sockets or pipes. However

I'm putting this on hold for now, and I'll stay with the docker client until openapi-generator is fixed.

MisterDA commented 2 years ago

Now depends on

MisterDA commented 2 years ago

I lost the race to merge before macOS. The rebase wasn't easy, I've probably broken one or two new things in my code.