mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-24 04:08:04 +08:00
history: add history import command
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
21
util/desktop/paths_darwin.go
Normal file
21
util/desktop/paths_darwin.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package desktop
|
||||
|
||||
import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
const (
|
||||
socketName = "docker-desktop-build.sock"
|
||||
socketPath = "Library/Containers/com.docker.docker/Data"
|
||||
)
|
||||
|
||||
func BuildServerAddr() (string, error) {
|
||||
dir, err := os.UserHomeDir()
|
||||
if err != nil {
|
||||
return "", errors.Wrap(err, "failed to get user home directory")
|
||||
}
|
||||
return "unix://" + filepath.Join(dir, socketPath, socketName), nil
|
||||
}
|
21
util/desktop/paths_linux.go
Normal file
21
util/desktop/paths_linux.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package desktop
|
||||
|
||||
import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
const (
|
||||
socketName = "docker-desktop-build.sock"
|
||||
socketPath = ".docker/desktop"
|
||||
)
|
||||
|
||||
func BuildServerAddr() (string, error) {
|
||||
dir, err := os.UserHomeDir()
|
||||
if err != nil {
|
||||
return "", errors.Wrap(err, "failed to get user home directory")
|
||||
}
|
||||
return "unix://" + filepath.Join(dir, socketPath, socketName), nil
|
||||
}
|
13
util/desktop/paths_unsupported.go
Normal file
13
util/desktop/paths_unsupported.go
Normal file
@@ -0,0 +1,13 @@
|
||||
//go:build !windows && !darwin && !linux
|
||||
|
||||
package desktop
|
||||
|
||||
import (
|
||||
"runtime"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
func BuildServerAddr() (string, error) {
|
||||
return "", errors.Errorf("Docker Desktop unsupported on %s", runtime.GOOS)
|
||||
}
|
5
util/desktop/paths_windows.go
Normal file
5
util/desktop/paths_windows.go
Normal file
@@ -0,0 +1,5 @@
|
||||
package desktop
|
||||
|
||||
func BuildServerAddr() (string, error) {
|
||||
return "npipe:////./pipe/dockerDesktopBuildServer", nil
|
||||
}
|
Reference in New Issue
Block a user