From 541f307dd11ee8204e6bd06f6b879d9a08d3226c Mon Sep 17 00:00:00 2001 From: Nick Tate Date: Mon, 19 Sep 2022 11:07:20 -0400 Subject: [PATCH] Ntate/appdev/macossupport (#1235) * mount docker.sock.raw for mac docker-for-desktop * update local builder to v0.50.2 --- internal/apps/builder/cnb.go | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/internal/apps/builder/cnb.go b/internal/apps/builder/cnb.go index fcadcfe9af..461f636c26 100644 --- a/internal/apps/builder/cnb.go +++ b/internal/apps/builder/cnb.go @@ -7,6 +7,7 @@ import ( "errors" "fmt" "path/filepath" + "runtime" "sort" "strings" "time" @@ -24,7 +25,7 @@ import ( const ( // CNBBuilderImage represents the local cnb builder. - CNBBuilderImage = "digitaloceanapps/cnb-local-builder:v0.49.0" + CNBBuilderImage = "digitaloceanapps/cnb-local-builder:v0.50.2" appVarAllowListKey = "APP_VARS" appVarPrefix = "APP_VAR_" @@ -63,9 +64,16 @@ func (b *CNBComponentBuilder) Build(ctx context.Context) (res ComponentBuilderRe return res, fmt.Errorf("configuring environment variables: %w", err) } - sourceDockerSock, err := filepath.EvalSymlinks(dockerSocketPath) - if err != nil { - return res, fmt.Errorf("finding docker engine socket: %w", err) + var sourceDockerSock string + switch runtime.GOOS { + case "darwin": + // mac docker-for-desktop includes the raw socket in the VM + sourceDockerSock = "/var/run/docker.sock.raw" + default: + sourceDockerSock, err = filepath.EvalSymlinks(dockerSocketPath) + if err != nil { + return res, fmt.Errorf("finding docker engine socket: %w", err) + } } mounts := []mount.Mount{{