Skip to content

Commit

Permalink
Disable docker and alias to podman in FCOS ignition
Browse files Browse the repository at this point in the history
Signed-off-by: Jason Greene <[email protected]>
  • Loading branch information
n1hility committed Sep 23, 2021
1 parent aa628b8 commit 7039862
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions pkg/machine/ignition.go
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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{
Expand All @@ -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,
Expand Down

0 comments on commit 7039862

Please sign in to comment.