Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ntate/appdev/macossupport #1235

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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