Merge pull request #2473 from afbjorklund/systemd-rootless

Add systemd support for rootless buildkitd
master
Tõnis Tiigi 2021-11-22 16:43:45 -08:00 committed by GitHub
commit d5b7ce35d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 34 additions and 0 deletions

View File

@ -5,6 +5,7 @@ After=buildkit.socket
Documentation=https://github.com/moby/buildkit
[Service]
Type=notify
ExecStart=/usr/local/bin/buildkitd --addr fd://
[Install]

View File

@ -0,0 +1,12 @@
[Unit]
Requires=buildkit.service
After=buildkit.service
Requires=buildkit-proxy.socket
After=buildkit-proxy.socket
[Service]
# need to use proxy because rootlesskit does not forward the fd://3
ExecStart=/usr/lib/systemd/systemd-socket-proxyd %t/buildkit/rootless
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,10 @@
[Unit]
Description=BuildKit
Documentation=https://github.com/moby/buildkit
[Socket]
ListenStream=%t/buildkit/buildkitd.sock
SocketMode=0660
[Install]
WantedBy=sockets.target

View File

@ -0,0 +1,11 @@
[Unit]
Description=BuildKit
Documentation=https://github.com/moby/buildkit
[Service]
Type=notify
NotifyAccess=all
ExecStart=rootlesskit --net=slirp4netns --copy-up=/etc --disable-host-loopback /usr/local/bin/buildkitd --addr unix://%t/buildkit/rootless
[Install]
WantedBy=multi-user.target