We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Q1:请问项目中代码的开发环境是什么?
我使用 mac 开发,按照示例中的代码编写时,发现有些API是不兼容的。所以我采用了 remote-dev 的方式开启了一个容器,在容器中开发,这样 API 的操作系统不兼容的问题解决了。
我容器开发环境如下:go1.15.3 linux/amd64
Q2:为什么会出现 fork/exec /bin/sh: operation not permitted exit status 1?
func main() { cmd := exec.Command("sh") cmd.SysProcAttr = &syscall.SysProcAttr{Cloneflags: syscall.CLONE_NEWUTS} cmd.Stdin = os.Stdin cmd.Stdout = os.Stdout cmd.Stderr = os.Stderr if err := cmd.Run(); err != nil { log.Fatal(err) } }
执行
go run main.go
报错: fork/exec /bin/sh: operation not permitted exit status 1
The text was updated successfully, but these errors were encountered:
运行的容器没有root权限,加上 --privileged 参数,才能使容器拥有root权限。
Sorry, something went wrong.
运行的容器没有root权限,加上--特权参数,才能使容器拥有root权限。 他这个不是容器啊,哪来的--privileged参数啊,只是没有权限获取系统的CLONE_NEWUTS,sudo就可以了
如果要在一个ubuntu的docker容器中运行的mydocker,需要--privileged
No branches or pull requests
Q1:请问项目中代码的开发环境是什么?
我使用 mac 开发,按照示例中的代码编写时,发现有些API是不兼容的。所以我采用了 remote-dev 的方式开启了一个容器,在容器中开发,这样 API 的操作系统不兼容的问题解决了。
我容器开发环境如下:go1.15.3 linux/amd64
Q2:为什么会出现 fork/exec /bin/sh: operation not permitted exit status 1?
执行
报错:
fork/exec /bin/sh: operation not permitted exit status 1
The text was updated successfully, but these errors were encountered: