mirror of
https://github.com/containers/podman.git
synced 2025-10-14 17:55:51 +08:00
Set machine docker.sock according to rootful flag
Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
This commit is contained in:
28
pkg/machine/update.go
Normal file
28
pkg/machine/update.go
Normal file
@ -0,0 +1,28 @@
|
||||
//go:build amd64 || arm64
|
||||
// +build amd64 arm64
|
||||
|
||||
package machine
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
func UpdatePodmanDockerSockService(vm VM, name string, uid int, rootful bool) error {
|
||||
content := GetPodmanDockerTmpConfig(uid, rootful, false)
|
||||
command := fmt.Sprintf("'echo %q > %s'", content, PodmanDockerTmpConfPath)
|
||||
args := []string{"sudo", "bash", "-c", command}
|
||||
if err := vm.SSH(name, SSHOptions{Args: args}); err != nil {
|
||||
logrus.Warnf("Could not not update internal docker sock config")
|
||||
return err
|
||||
}
|
||||
|
||||
args = []string{"sudo", "systemd-tmpfiles", "--create", "--prefix=/run/docker.sock"}
|
||||
if err := vm.SSH(name, SSHOptions{Args: args}); err != nil {
|
||||
logrus.Warnf("Could not create internal docker sock")
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
Reference in New Issue
Block a user