Set the container's hostname to the truncated ID
This commit is contained in:
parent
6bf4a10ed4
commit
54fa59c8ec
|
@ -69,9 +69,15 @@ func (runtime *Runtime) Create(config *Config) (*Container, error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
// Generate id
|
||||||
|
id := GenerateId()
|
||||||
|
// Generate default hostname
|
||||||
|
if config.Hostname == "" {
|
||||||
|
config.Hostname = id[:12]
|
||||||
|
}
|
||||||
container := &Container{
|
container := &Container{
|
||||||
// FIXME: we should generate the ID here instead of receiving it as an argument
|
// FIXME: we should generate the ID here instead of receiving it as an argument
|
||||||
Id: GenerateId(),
|
Id: id,
|
||||||
Created: time.Now(),
|
Created: time.Now(),
|
||||||
Path: config.Cmd[0],
|
Path: config.Cmd[0],
|
||||||
Args: config.Cmd[1:], //FIXME: de-duplicate from config
|
Args: config.Cmd[1:], //FIXME: de-duplicate from config
|
||||||
|
|
Loading…
Reference in New Issue