Fix docker user and write configuration to disk when setting user
This commit is contained in:
@@ -24,8 +24,8 @@ import (
|
||||
type DockerEnvironment struct {
|
||||
Server *Server
|
||||
|
||||
// The user that containers should be running as.
|
||||
User string
|
||||
// The user ID that containers should be running as.
|
||||
User int
|
||||
|
||||
// Defines the configuration for the Docker instance that will allow us to connect
|
||||
// and create and modify containers.
|
||||
@@ -43,6 +43,7 @@ func NewDockerEnvironment(opts ...func(*DockerEnvironment)) (*DockerEnvironment,
|
||||
}
|
||||
|
||||
env := &DockerEnvironment{
|
||||
User: 1000,
|
||||
Client: cli,
|
||||
}
|
||||
|
||||
@@ -157,7 +158,7 @@ func (d *DockerEnvironment) Create() error {
|
||||
|
||||
conf := &container.Config{
|
||||
Hostname: "container",
|
||||
User: d.User,
|
||||
User: strconv.Itoa(d.User),
|
||||
AttachStdin: true,
|
||||
AttachStdout: true,
|
||||
AttachStderr: true,
|
||||
|
||||
@@ -171,7 +171,7 @@ func FromConfiguration(data []byte, cfg *config.SystemConfiguration) (*Server, e
|
||||
}
|
||||
|
||||
withConfiguration := func (e *DockerEnvironment) {
|
||||
e.User = cfg.User
|
||||
e.User = cfg.User.Uid
|
||||
e.TimezonePath = cfg.TimezonePath
|
||||
e.Server = s
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user