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

在Docker中难以运行 #73

Open
comzyh opened this issue Dec 21, 2018 · 0 comments
Open

在Docker中难以运行 #73

comzyh opened this issue Dec 21, 2018 · 0 comments

Comments

@comzyh
Copy link

comzyh commented Dec 21, 2018

使用Alpine镜像启动会提示

panic: user: Current not implemented on linux/amd64

goroutine 1 [running]:
github.com/sipt/shuttle/extension/config.init.0()
	/Users/sipt/Documents/GOPATH/src/github.com/sipt/shuttle/extension/config/config_path.go:17 +0x20f

经查,

u, err := user.Current()

user.Current() 依赖 "$USER" 环境变量,一般docker环境并无这个环境变量,所以会报错;

如果ShuttleHomeDir变量仅在upgrade的时候使用,能否在upgrade的时候再手动调用相关函数,不写在init() 中?

同时给出一个临时的解决方法:
在Docker container 中添加一个环境变量USER=root

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant