daemon/containerd: containerConfigToOciImageConfig: add ArgsEscaped

The OCI image-spec now also provides ArgsEscaped for backward compatibility
with the option used by Docker.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2023-04-29 00:20:07 +02:00
parent e22758bfb2
commit e510abbc8c
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C

View file

@ -383,14 +383,15 @@ func storeJson(ctx context.Context, cs content.Ingester, mt string, obj interfac
func containerConfigToOciImageConfig(cfg *container.Config) ocispec.ImageConfig { func containerConfigToOciImageConfig(cfg *container.Config) ocispec.ImageConfig {
ociCfg := ocispec.ImageConfig{ ociCfg := ocispec.ImageConfig{
User: cfg.User, User: cfg.User,
Env: cfg.Env, Env: cfg.Env,
Entrypoint: cfg.Entrypoint, Entrypoint: cfg.Entrypoint,
Cmd: cfg.Cmd, Cmd: cfg.Cmd,
Volumes: cfg.Volumes, Volumes: cfg.Volumes,
WorkingDir: cfg.WorkingDir, WorkingDir: cfg.WorkingDir,
Labels: cfg.Labels, Labels: cfg.Labels,
StopSignal: cfg.StopSignal, StopSignal: cfg.StopSignal,
ArgsEscaped: cfg.ArgsEscaped,
} }
for k, v := range cfg.ExposedPorts { for k, v := range cfg.ExposedPorts {
ociCfg.ExposedPorts[string(k)] = v ociCfg.ExposedPorts[string(k)] = v