test systemd-run in container
146
#!/bin/sh
systemd-run --scope --slice=system sleep 3d &
wait
FROM ubuntu:18.04
RUN apt-get update && apt-get install -y systemd
ADD test.sh /
ENTRYPOINT ["/test.sh"]
CMD []
docker run --name foo --pid host --ipc host --net host --privileged -d -v /run/dbus/system_bus_socket:/run/dbus/system_bus_socket:ro xinfengliu/test-systemd-run
apiVersion: v1
kind: Pod
metadata:
name: foo
labels:
app: foo
spec:
containers:
- name: foo
image: xinfengliu/test-systemd-run:latest
imagePullPolicy: IfNotPresent
securityContext:
privileged: true
volumeMounts:
- mountPath: /run/dbus/system_bus_socket
name: sbs
nodeSelector:
worker: ""
hostNetwork: true
hostPID: true
hostIPC: true
volumes:
- hostPath:
path: /run/dbus/system_bus_socket
type: ""
name: sbs
Content type
Image
Digest
Size
82.9 MB
Last updated
about 5 years ago
docker pull xinfengliu/test-systemd-run