-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain_other.go
More file actions
31 lines (25 loc) · 1.08 KB
/
Copy pathmain_other.go
File metadata and controls
31 lines (25 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
//go:build !linux
// Non-Linux stub. agentenv's runtime is Linux-only (Linux user namespaces +
// pivot_root, btrfs subvolumes, copy-backend sandbox), so this file exists only
// so that `go build .` on macOS/Windows produces a useful error binary instead
// of a cryptic "no Go files in <dir>" message — and points the user at how to
// actually try it (Docker on the host, or the developer-mode docs).
package main
import (
"fmt"
"os"
"runtime"
)
func main() {
fmt.Fprintf(os.Stderr, `agentenv: the runtime is Linux-only — it uses Linux user namespaces +
pivot_root, which don't exist on %s.
To try it without a Linux box, run the demo via Docker (rootless, no
--privileged, mirrors a restricted Kubernetes pod):
docker run --rm --user 1001:1001 --security-opt seccomp=unconfined \
-v "$PWD":/src:ro -e CGO_ENABLED=0 -e GOCACHE=/tmp/gocache -e HOME=/tmp \
-w /src golang:1.26 bash /src/examples/demo/killer-demo.sh
For development on macOS (Cursor / VS Code with full Go intel-sense), see the
"Developing on macOS / Windows" section of the README.
`, runtime.GOOS)
os.Exit(1)
}