https://pantsbuild.org/ logo
s

some-farmer-97614

02/07/2022, 10:26 AM
Hi! Is there a pants plugin that allows to build docker images declaratively instead of using dockerfiles without using the docker daemon?
c

curved-television-6568

02/07/2022, 10:32 AM
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

some-farmer-97614

02/07/2022, 10:40 AM
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

curved-television-6568

02/07/2022, 11:27 AM
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

happy-kitchen-89482

02/07/2022, 4:12 PM
@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

some-farmer-97614

02/07/2022, 4:48 PM
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

curved-television-6568

02/07/2022, 4:50 PM
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

hundreds-father-404

02/07/2022, 4:52 PM
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

some-farmer-97614

02/07/2022, 4:53 PM
Hehehe, I’d be happy if I get (1)
💯 1
✔️ 1
h

hundreds-father-404

02/07/2022, 4:57 PM
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

curved-television-6568

02/07/2022, 4:59 PM
worth considering is if buildkit is packaged attractively in https://github.com/genuinetools/img
👀 1
💯 1
b

busy-vase-39202

02/08/2022, 12:03 AM
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

some-farmer-97614

02/08/2022, 9:53 AM
b

busy-vase-39202

02/08/2022, 5:52 PM
Thanks!
3 Views