...
1 package main
2
3 import (
4 "context"
5 "os"
6 "syscall"
7
8 "github.com/datawire/dlib/dlog"
9 )
10
11 func main() {
12 ctx := context.Background()
13 dlog.Println(ctx, "Starting Envoy with CAP_NET_BIND_SERVICE capability")
14
15 if err := capset(); err != nil {
16 dlog.Error(ctx, err)
17 os.Exit(126)
18 }
19
20 dlog.Println(ctx, "Succeeded in setting capabilities")
21
22 if err := syscall.Exec("/usr/local/bin/envoy", os.Args, os.Environ()); err != nil {
23 dlog.Error(ctx, err)
24 os.Exit(127)
25 }
26 }
27
View as plain text