Add docker file

pull/863/head
Ruslan Savchuk 2025-03-27 10:37:56 +01:00
parent 84a1a1beef
commit 09e3d0e5a1
2 changed files with 33 additions and 0 deletions

15
Dockerfile Normal file
View File

@ -0,0 +1,15 @@
FROM ubuntu:22.04
# Update package list and install systemd
# RUN apt-get update && apt-get install -y systemd && rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install -y systemd kmod systemd-sysv && rm -rf /var/lib/apt/lists/*
# Configure systemd (optional: set default target)
RUN systemctl set-default multi-user.target
# Remove unnecessary systemd units to speed up boot (optional)
RUN find /etc/systemd/system /lib/systemd/system \
-path '*.wants/*' -not -name '*systemd*' -exec rm -f {} \;
# Set systemd as the entrypoint
ENTRYPOINT ["/lib/systemd/systemd", "--system"]

View File

@ -23,3 +23,21 @@ To configure the cluster mentioned, we will use Ubuntu server 20.04 (author uses
* [Controller manager](./docs/08-controller-manager.md)
* [Kube-proxy](./docs/09-kubeproxy.md)
* [DNS in Kubernetes](./docs/10-dns.md)
docker build -t ubuntu-systemd .
docker run -d \
--name ubuntu-systemd-container \
--privileged \
--security-opt seccomp=unconfined \
--security-opt apparmor=unconfined \
-v /sys/fs/cgroup:/sys/fs/cgroup:rw \
-v /lib/modules:/lib/modules:ro \
--tmpfs /tmp \
--tmpfs /run \
--tmpfs /run/lock \
kindest/base:v20250312-b98dc21a \
/sbin/init