From 7039862460bf1aad31f993dee1345529378109df Mon Sep 17 00:00:00 2001 From: "Jason T. Greene" Date: Tue, 21 Sep 2021 22:32:49 -0500 Subject: [PATCH] Disable docker and alias to podman in FCOS ignition Signed-off-by: Jason Greene --- pkg/machine/ignition.go | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/pkg/machine/ignition.go b/pkg/machine/ignition.go index 89b556b145..7198f54669 100644 --- a/pkg/machine/ignition.go +++ b/pkg/machine/ignition.go @@ -80,6 +80,7 @@ func NewIgnitionFile(ign DynamicIgnition) error { // so a listening host knows it can being interacting with it ready := `[Unit] Requires=dev-virtio\\x2dports-%s.device +After=replace-moby.service OnFailure=emergency.target OnFailureJobMode=isolate [Service] @@ -89,6 +90,25 @@ ExecStart=/bin/sh -c '/usr/bin/echo Ready >/dev/%s' [Install] RequiredBy=multi-user.target ` + deMoby := `[Unit] +Description=Remove moby-engine, alias podman +# Run once for the machine +After=systemd-machine-id-commit.service +Before=zincati.service +ConditionPathExists=!/var/lib/%N.stamp + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=/usr/bin/rpm-ostree override remove moby-engine +ExecStart=/bin/ln -fs /usr/bin/podman /usr/local/bin/docker +ExecStart=/bin/ln -fs /run/podman/podman.sock /run/docker.sock +ExecStart=/bin/touch /var/lib/%N.stamp +ExecStart=/usr/bin/rpm-ostree ex apply-live --allow-replacement + +[Install] +WantedBy=multi-user.target + ` _ = ready ignSystemd := Systemd{ Units: []Unit{ @@ -101,6 +121,15 @@ RequiredBy=multi-user.target Name: "ready.service", Contents: strToPtr(fmt.Sprintf(ready, "vport1p1", "vport1p1")), }, + { + Name: "docker.service", + Mask: boolToPtr(true), + }, + { + Enabled: boolToPtr(true), + Name: "replace-moby.service", + Contents: &deMoby, + }, }} ignConfig := Config{ Ignition: ignVersion,