Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

Fixes issue 270: footloose container fails to start after upgrading t… #271

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions images/debian11/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
FROM debian:bullseye

ENV container docker

# Don't start any optional services except for the few we need.
RUN find /etc/systemd/system \
/lib/systemd/system \
-path '*.wants/*' \
-not -name '*journald*' \
-not -name '*systemd-tmpfiles*' \
-not -name '*systemd-user-sessions*' \
-exec rm \{} \;

RUN apt-get update && \
apt-get install -y \
dbus systemd openssh-server net-tools iproute2 iputils-ping curl wget vim-tiny sudo && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

EXPOSE 22

RUN systemctl set-default multi-user.target
RUN systemctl mask \
dev-hugepages.mount \
sys-fs-fuse-connections.mount \
systemd-update-utmp.service \
systemd-tmpfiles-setup.service \
console-getty.service

# This container image doesn't have locales installed. Disable forwarding the
# user locale env variables or we get warnings such as:
# bash: warning: setlocale: LC_ALL: cannot change locale
RUN sed -i -e 's/^AcceptEnv LANG LC_\*$/#AcceptEnv LANG LC_*/' /etc/ssh/sshd_config

# https://www.freedesktop.org/wiki/Software/systemd/ContainerInterface/
STOPSIGNAL SIGRTMIN+3

CMD ["/bin/bash"]
3 changes: 2 additions & 1 deletion pkg/cluster/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,8 @@ func (c *Cluster) createMachineRunArgs(machine *Machine, name string, i int) []s
"--tmpfs", "/run",
"--tmpfs", "/run/lock",
"--tmpfs", "/tmp:exec,mode=777",
"-v", "/sys/fs/cgroup:/sys/fs/cgroup:ro",
"--cgroupns", "host",
"-v", "/sys/fs/cgroup:/sys/fs/cgroup:rw",
Comment on lines +297 to +298

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this needs to be a conditional setup as not all systems using footloose will have cgroups v2 in place. Or at least it needs to be made sure this does not break cgroups v1 based setups of docker. E.g. we (https://github.com/k0sproject/k0s) use footloose heavily without Docker Desktop e.g. in our CI where the runners are cgroups v1 based.

}

for _, volume := range machine.spec.Volumes {
Expand Down