mirror of
https://github.com/linka-cloud/d2vm.git
synced 2025-06-23 22:02:25 +00:00
set user permissions on image if run with sudo or in docker run/vbox & run/hetzner: run qemu-img in docker if not available in path Signed-off-by: Adphi <philippe.adrien.nousse@gmail.com>
This commit is contained in:
@ -97,7 +97,6 @@ func Pull(ctx context.Context, tag string) error {
|
||||
}
|
||||
|
||||
func RunInteractiveAndRemove(ctx context.Context, args ...string) error {
|
||||
logrus.Tracef("running 'docker run --rm -i -t %s'", strings.Join(args, " "))
|
||||
cmd := exec.CommandContext(ctx, "docker", append([]string{"run", "--rm", "-it"}, args...)...)
|
||||
cmd.Stdin = os.Stdin
|
||||
cmd.Stdout = os.Stdout
|
||||
@ -129,6 +128,9 @@ func RunD2VM(ctx context.Context, image, version, in, out, cmd string, args ...s
|
||||
}
|
||||
a := []string{
|
||||
"--privileged",
|
||||
"-e",
|
||||
// yes... it is kind of a dirty hack
|
||||
fmt.Sprintf("SUDO_UID=%d", os.Getuid()),
|
||||
"-v",
|
||||
fmt.Sprintf("%s:/var/run/docker.sock", dockerSocket()),
|
||||
"-v",
|
||||
|
Reference in New Issue
Block a user