Skip to content

Commit

Permalink
Ntate/appdev/macossupport (digitalocean#1235)
Browse files Browse the repository at this point in the history
* mount docker.sock.raw for mac docker-for-desktop

* update local builder to v0.50.2
  • Loading branch information
nicktate committed Sep 19, 2022
1 parent 5b49c3c commit b6e840c
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions internal/apps/builder/cnb.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"errors"
"fmt"
"path/filepath"
"runtime"
"sort"
"strings"
"time"
Expand All @@ -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_"
Expand Down Expand Up @@ -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{{
Expand Down

0 comments on commit b6e840c

Please sign in to comment.