Hi! Is there a pants plugin that allows to build d...
# general
s
Hi! Is there a pants plugin that allows to build docker images declaratively instead of using dockerfiles without using the docker daemon?
c
For the Docker backend in Pantsbuild, you can provide the instructions inline, so you don’t have to provide a separate Dockerfile (it will be generated for you), but it does still rely on the docker daemon to actually build the image.
s
Yes, that's how I thought it would be. I think bazels rules_docker work without docker and would like to have something similar in pants
c
That would be a nice addition to the container support, if we could use BuildKit or similar directly, rather than relying on a Docker client talking to a daemon.
h
@some-farmer-97614 could you open a ticket for that feature request at https://github.com/pantsbuild/pants/issues/new/choose ? that way we can track work on it
s
It would be great if we could clarify this further before that. I wanted: 1. To be able to build without root permissions or a docker daemon running (e.g. build inside containers) 2. Have minimal and reproducible container images build without DOCKERFILE Bazel rules_docker seems to offer (1) & (2) at the cost of using it’s own configuration language and not having RUN instructions. However (2) also goes against pants philosophy a bit, as pants seems to prefer to integrate with the tools directly and not offer it’s own way. I am not sure if using e.g.
BuildKit
also could offer (1), as I don’t know the state of rootless builds in
BuildKit
c
I’ve no direct experience with it, but there is some documentation regarding running buildkitd rootless: https://github.com/moby/buildkit/blob/master/docs/rootless.md
However, that would only work for Linux based OS’es..
👍 1
h
However (2) also goes against pants philosophy a bit, as pants seems to prefer to integrate with the tools directly and not offer it’s own way.
You're right. We indeed in general try to keep magic to a minimum and integrate with tools that already work really well -- make them even better by combining tools in powerful tools, with a consistent interface. However, we also are very motivated to solve the real problems users face, so happy to get creative exploring how we can get this working 🙂
s
Hehehe, I’d be happy if I get (1)
💯 1
✔️ 1
h
Great! So (1) sounds like two feature requests? a) build Docker w/o Docker daemon running, probably via BuildKit b) have that feature work in rootless mode, https://github.com/moby/buildkit/blob/master/docs/rootless.md
c
worth considering is if buildkit is packaged attractively in https://github.com/genuinetools/img
👀 1
💯 1
b
Sounds like the spec is clear enough to become a ticket. @some-farmer-97614 would you open one, so folks can start developing this further?
s
b
Thanks!