Sign inSign up

xinfengliu/test-systemd-run

By xinfengliu

Updated about 5 years ago

test systemd-run in container

Image
0

146

xinfengliu/test-systemd-run repository overview

Test systemd-run in container, it will cause different behavior in docker cri and containerd cri.

test.sh
#!/bin/sh
systemd-run --scope --slice=system sleep 3d &
wait
Dockerfile
FROM ubuntu:18.04
RUN apt-get update && apt-get install -y systemd
ADD test.sh /
ENTRYPOINT ["/test.sh"]
CMD []
docker run
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
systemd-run.yaml
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

Tag summary

Content type

Image

Digest

Size

82.9 MB

Last updated

about 5 years ago

docker pull xinfengliu/test-systemd-run