Skip to content

Commit

Permalink
Exposed docker socket when docker enabled and running under docker da…
Browse files Browse the repository at this point in the history
…emon.
  • Loading branch information
GrahamDumpleton committed Oct 23, 2022
1 parent 6920106 commit e3d6894
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions client-programs/educates/cmd/dockerworkshopdeploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,18 @@ func (o *DockerWorkshopDeployOptions) Run() error {
})
}

dockerEnabled, found, _ := unstructured.NestedBool(workshop.Object, "spec", "session", "applications", "docker", "enabled")

if found && dockerEnabled {
filesMounts = append(filesMounts, mount.Mount{
Type: "bind",
// XXX May need to detect when docker desktop to use raw socket alias.
Source: "/var/run/docker.sock.raw",
Target: "/var/run/docker/docker.sock",
ReadOnly: true,
})
}

image, found, err := unstructured.NestedString(workshop.Object, "spec", "workshop", "image")

if err != nil {
Expand Down

0 comments on commit e3d6894

Please sign in to comment.