mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-21 10:09:07 +00:00
Merge pull request #192 from w9n/fix_empty_container_config
allow ImageInspect.Config to be nil when parsing
This commit is contained in:
commit
b5615a3714
@ -702,9 +702,9 @@ func ConfigInspectToOCI(yaml *Image, inspect types.ImageInspect, idMap map[strin
|
|||||||
oci := specs.Spec{}
|
oci := specs.Spec{}
|
||||||
runtime := Runtime{}
|
runtime := Runtime{}
|
||||||
|
|
||||||
var inspectConfig container.Config
|
inspectConfig := &container.Config{}
|
||||||
if inspect.Config != nil {
|
if inspect.Config != nil {
|
||||||
inspectConfig = *inspect.Config
|
inspectConfig = inspect.Config
|
||||||
}
|
}
|
||||||
|
|
||||||
// look for org.mobyproject.config label
|
// look for org.mobyproject.config label
|
||||||
@ -721,7 +721,7 @@ func ConfigInspectToOCI(yaml *Image, inspect types.ImageInspect, idMap map[strin
|
|||||||
// command, env and cwd can be taken from image, as they are commonly specified in Dockerfile
|
// command, env and cwd can be taken from image, as they are commonly specified in Dockerfile
|
||||||
|
|
||||||
// TODO we could handle entrypoint and cmd independently more like Docker
|
// TODO we could handle entrypoint and cmd independently more like Docker
|
||||||
inspectCommand := append(inspectConfig.Entrypoint, inspect.Config.Cmd...)
|
inspectCommand := append(inspectConfig.Entrypoint, inspectConfig.Cmd...)
|
||||||
args := assignStrings3(inspectCommand, label.Command, yaml.Command)
|
args := assignStrings3(inspectCommand, label.Command, yaml.Command)
|
||||||
|
|
||||||
env := assignStrings3(inspectConfig.Env, label.Env, yaml.Env)
|
env := assignStrings3(inspectConfig.Env, label.Env, yaml.Env)
|
||||||
|
Loading…
Reference in New Issue
Block a user