This repository was archived by the owner on Apr 2, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDockerfile
39 lines (32 loc) · 1.63 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!BuildTag: libvirtd
#
# podman pull registry.opensuse.org/home/RobinR1/containers/containers/libvirtd:latest
#
FROM opensuse/tumbleweed
MAINTAINER Robin Roevens <[email protected]>
RUN zypper ref && \
# Work around https://github.com/openSUSE/obs-build/issues/487 \
zypper install -y openSUSE-release-appliance-docker && \
zypper -n in qemu-tools qemu-kvm libvirt-daemon-qemu libvirt-client insserv-compat && \
zypper clean -a ; \
(cd /usr/lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; done); \
rm -f /usr/lib/systemd/system/multi-user.target.wants/*;\
rm -f /etc/systemd/system/*.wants/*;\
rm -f /usr/lib/systemd/system/local-fs.target.wants/*; \
rm -f /usr/lib/systemd/system/sockets.target.wants/*udev*; \
rm -f /usr/lib/systemd/system/sockets.target.wants/*initctl*; \
rm -f /usr/lib/systemd/system/basic.target.wants/*; \
rm -f /usr/lib/systemd/system/anaconda.target.wants/*; \
# appropriately change permissions of the /dev/kvm device which is normally done by a udev rule \
sed -i "/Service/a ExecStartPost=\/bin\/chmod 666 /dev/kvm" /usr/lib/systemd/system/libvirtd.service ; \
systemctl enable libvirtd; systemctl enable virtlockd; systemctl enable libvirt-guests
RUN zypper -n in openssh && \
systemctl enable sshd && \
mkdir -p /root/.ssh
COPY ["container_init.sh", "/usr/bin/"]
COPY ["container_init.service", "/etc/systemd/system/"]
RUN systemctl enable container_init
VOLUME [ "/sys/fs/cgroup" ]
VOLUME [ "/etc/libvirt/qemu" ]
VOLUME [ "/var/lib/libvirt" ]
CMD ["/usr/lib/systemd/systemd", "--system"]