Update systemd template

This commit is contained in:
Mikhail Gordeev 2023-08-28 13:23:34 +00:00 committed by Mikhail
parent 07568198f7
commit 27be13736a
2 changed files with 7 additions and 2 deletions

View File

@ -2,7 +2,9 @@ FROM {{ registry }}{{ organization }}/base:{{ branch }}
MAINTAINER alt-cloud
{{ install_pakages("systemd") }}
ENV container docker
{{ install_pakages("systemd-sysvinit") }}
RUN ( \
cd /lib/systemd/system/sysinit.target.wants/; \
@ -17,4 +19,6 @@ RUN ( \
rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \
rm -f /lib/systemd/system/basic.target.wants/*;
VOLUME ["/sys/fs/cgroup"]
CMD ["/sbin/init"]

View File

@ -7,4 +7,5 @@ Copy Dockerfile somewhere and build the image:
`$ docker build --rm -t <username>/systemd .`
And launch the systemd container:
`docker run -it <username>/systemd`
`docker run -d --name systemd --tmpfs /tmp --tmpfs /run --tmpfs /run/lock -v /sys/fs/cgroup:/sys/fs/cgroup:ro <username>/systemd`
`docker exec -it systemd bash`