Skip to content

[1.10+] Image Layer "container_config.Cmd" Format Change #22436

@tianon

Description

@tianon

Output of docker version:

Client:
 Version:      1.11.1
 API version:  1.23
 Go version:   go1.5.4
 Git commit:   5604cbe
 Built:        Wed Apr 27 00:34:20 2016
 OS/Arch:      linux/amd64

Server:
 Version:      1.11.1
 API version:  1.23
 Go version:   go1.5.4
 Git commit:   5604cbe
 Built:        Wed Apr 27 00:34:20 2016
 OS/Arch:      linux/amd64

Output of docker info:

Containers: 0
 Running: 0
 Paused: 0
 Stopped: 0
Images: 0
Server Version: 1.11.1
Storage Driver: overlay
 Backing Filesystem: extfs
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins: 
 Volume: local
 Network: bridge null host
Kernel Version: 4.1.17-gentoo
Operating System: Alpine Linux v3.3 (containerized)
OSType: linux
Architecture: x86_64
CPUs: 8
Total Memory: 31.14 GiB
Name: 16f4367dd1c4
ID: R3AA:MSLS:P53W:RPDZ:JVFB:CUJV:KGF4:TFXZ:HFSM:SZXY:6MJ6:UWBA
Docker Root Dir: /var/lib/docker
Debug mode (client): false
Debug mode (server): false
Registry: https://index.docker.io/v1/
WARNING: bridge-nf-call-iptables is disabled
WARNING: bridge-nf-call-ip6tables is disabled

Steps to reproduce the issue:

  1. build an image with MAINTAINER, COPY, CMD (or similar non-RUN commands)
  2. push the image to a registry
  3. inspect the manifest (specifically, .history[].v1Compatibility | fromjson)

Describe the results you received:

  "container_config": {
    "Cmd": [
      "/bin/sh -c #(nop) ADD file:9a7009973be82c34ab6e18180f08fdc4c2f039806226ce7a48ba9361efe4804b in /"
    ]
  }

Describe the results you expected:

  "container_config": {
    "Cmd": [
      "/bin/sh",
      "-c",
      "#(nop) ADD file:9a7009973be82c34ab6e18180f08fdc4c2f039806226ce7a48ba9361efe4804b in /"
    ]
  }

(as in 1.9 and previous)

This gets even more fun when "build args" are used, since they're stored with a strange pipe-prefixed format that's only really parseable in the array syntax (so the "smashed string" version really screws parsing up there).

Here's an example of how "build args" exhibit themselves when pushed via 1.9:

[
  "|6",
  "a=1",
  "b=2",
  "c=3",
  "d=4",
  "e=a b c",
  "f=a b \" c",
  "/bin/sh",
  "-c",
  "echo hi"
]

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions