From 38c78381ca686b0ef15a93e1a440c6302424bf78 Mon Sep 17 00:00:00 2001 From: Matej Vasek Date: Sat, 23 Oct 2021 00:11:41 +0200 Subject: [PATCH] Set DOCKER_HOST in the VM [NO TESTS NEEDED] Signed-off-by: Matej Vasek --- pkg/machine/ignition.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/pkg/machine/ignition.go b/pkg/machine/ignition.go index e211f5ea6b..42d729458d 100644 --- a/pkg/machine/ignition.go +++ b/pkg/machine/ignition.go @@ -304,6 +304,24 @@ machine_enabled=true }, }) + setDockerHost := `export DOCKER_HOST="unix://$(podman info -f "{{.Host.RemoteSocket.Path}}")" +` + + files = append(files, File{ + Node: Node{ + Group: getNodeGrp("root"), + Path: "/etc/profile.d/docker-host.sh", + User: getNodeUsr("root"), + }, + FileEmbedded1: FileEmbedded1{ + Append: nil, + Contents: Resource{ + Source: encodeDataURLPtr(setDockerHost), + }, + Mode: intToPtr(0644), + }, + }) + return files }