Merge "Dockerfile: move into separate group when running under cgroupsv2"

This commit is contained in:
Zuul 2022-08-03 00:51:57 +00:00 committed by Gerrit Code Review
commit f20fed8c8d
1 changed files with 7 additions and 0 deletions

View File

@ -138,6 +138,13 @@ RUN \
apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# NOTE(ianw) 2022-08-02 : move this into its own cgroup on cgroupsv2
# hosts for nested podman calls to work; see comments in
# https://github.com/containers/podman/issues/14884
CMD _DAEMON_FLAG=${DEBUG:+-d} && \
_DAEMON_FLAG=${_DAEMON_FLAG:--f} && \
if [ -e /sys/fs/cgroup/cgroup.controllers ]; then \
sudo mkdir /sys/fs/cgroup/nodepool && \
for p in `cat /sys/fs/cgroup/cgroup.procs`; do echo $p | sudo tee /sys/fs/cgroup/nodepool/cgroup.procs || true; done \
fi; \
/usr/local/bin/nodepool-builder ${_DAEMON_FLAG}