{"action":"created","issue":{"url":"https://api.github.com/repos/docker/docker/issues/23308","repository_url":"https://api.github.com/repos/docker/docker","labels_url":"https://api.github.com/repos/docker/docker/issues/23308/labels{/name}","comments_url":"https://api.github.com/repos/docker/docker/issues/23308/comments","events_url":"https://api.github.com/repos/docker/docker/issues/23308/events","html_url":"https://github.com/docker/docker/issues/23308","id":158692555,"number":23308,"title":"Docker Build Arg unable to consume poor error output","user":{"login":"kitsushadow","id":5352672,"avatar_url":"https://avatars.githubusercontent.com/u/5352672?v=3","gravatar_id":"","url":"https://api.github.com/users/kitsushadow","html_url":"https://github.com/kitsushadow","followers_url":"https://api.github.com/users/kitsushadow/followers","following_url":"https://api.github.com/users/kitsushadow/following{/other_user}","gists_url":"https://api.github.com/users/kitsushadow/gists{/gist_id}","starred_url":"https://api.github.com/users/kitsushadow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kitsushadow/subscriptions","organizations_url":"https://api.github.com/users/kitsushadow/orgs","repos_url":"https://api.github.com/users/kitsushadow/repos","events_url":"https://api.github.com/users/kitsushadow/events{/privacy}","received_events_url":"https://api.github.com/users/kitsushadow/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/docker/docker/labels/area/builder","name":"area/builder","color":"0052cc"},{"url":"https://api.github.com/repos/docker/docker/labels/kind/enhancement","name":"kind/enhancement","color":"E8CAAF"},{"url":"https://api.github.com/repos/docker/docker/labels/version/1.10","name":"version/1.10","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-06-06T14:32:54Z","updated_at":"2016-06-08T09:53:15Z","closed_at":null,"body":"**Output of `docker version`:**  \r\n```\r\ndocker version\r\nClient:\r\n Version:      1.10.3\r\n API version:  1.22\r\n Go version:   go1.5.3\r\n Git commit:   20f81dd\r\n Built:        Thu Mar 10 21:49:11 2016\r\n OS/Arch:      linux/amd64\r\n\r\nServer:\r\n Version:      1.10.3\r\n API version:  1.22\r\n Go version:   go1.5.3\r\n Git commit:   20f81dd\r\n Built:        Thu Mar 10 21:49:11 2016\r\n OS/Arch:      linux/amd64\r\n```\r\n\r\n\r\n**Output of `docker info`:**  \r\n```\r\ndocker info\r\nContainers: 4\r\n Running: 1\r\n Paused: 0\r\n Stopped: 3\r\nImages: 3203\r\nServer Version: 1.10.3\r\nStorage Driver: devicemapper\r\n Pool Name: docker-202:2-1124190117-pool\r\n Pool Blocksize: 65.54 kB\r\n Base Device Size: 107.4 GB\r\n Backing Filesystem: xfs\r\n Data file: /dev/loop0\r\n Metadata file: /dev/loop1\r\n Data Space Used: 59.79 GB\r\n Data Space Total: 107.4 GB\r\n Data Space Available: 47.59 GB\r\n Metadata Space Used: 58.47 MB\r\n Metadata Space Total: 2.147 GB\r\n Metadata Space Available: 2.089 GB\r\n Udev Sync Supported: false\r\n Deferred Removal Enabled: false\r\n Deferred Deletion Enabled: false\r\n Deferred Deleted Device Count: 0\r\n Data loop file: /var/lib/docker/devicemapper/devicemapper/data\r\n WARNING: Usage of loopback devices is strongly discouraged for production use. Either use `--storage-opt dm.thinpooldev` or use `--storage-opt dm.no_warn_on_loop_devices=true` to suppress this warning.\r\n Metadata loop file: /var/lib/docker/devicemapper/devicemapper/metadata\r\n Library Version: 1.02.82 (2013-10-04)\r\nExecution Driver: native-0.2\r\nLogging Driver: json-file\r\nPlugins: \r\n Volume: local\r\n Network: bridge null host\r\nKernel Version: 3.10.0-327.3.1.el7.x86_64\r\nOperating System: Red Hat Enterprise Linux Server 7.2 (Maipo)\r\nOSType: linux\r\nArchitecture: x86_64\r\nCPUs: 4\r\nTotal Memory: 15.26 GiB\r\nName: ip-xx-xxx-xxx-xxx.xxx.xxx.xxx.xxx\r\nID: 4ZQV:TN5A:7PIJ:OFEX:46CS:MUNI:RK6C:H4AV:5RF4:GTQY:OPTN:O6XN\r\nWARNING: bridge-nf-call-iptables is disabled\r\nWARNING: bridge-nf-call-ip6tables is disabled\r\n```\r\n\r\nJENKINS\r\n\r\n**Steps to reproduce the issue:**\r\n1. Do not provide an environment variable for consumption during docker build --build-arg\r\n\r\n```\r\nStep 5 : ARG BUILDER_HOST\r\n ---> Running in 794a78698fd3\r\n ---> edc128bddd1a\r\nRemoving intermediate container 794a78698fd3\r\nStep 6 : ARG DOCKER_IMAGE\r\n ---> Running in 15ce05d7c755\r\n ---> 4f2d9989e3c7\r\nRemoving intermediate container 15ce05d7c755\r\nStep 7 : ARG GIT_REPO\r\n ---> Running in 0e37b61a7390\r\n ---> 80865f5bf341\r\nRemoving intermediate container 0e37b61a7390\r\nStep 8 : ARG GIT_BRANCH\r\n ---> Running in 8e7ec51219af\r\n ---> c3ef61652819\r\nRemoving intermediate container 8e7ec51219af\r\nStep 9 : ARG GIT_HASH\r\n ---> Running in 864b64a55ae1\r\n ---> ba7d139d2099\r\nRemoving intermediate container 864b64a55ae1\r\nStep 10 : ARG DOCKER_TAG\r\n ---> Running in 94c341a68baa\r\n ---> 03e8174ca405\r\nRemoving intermediate container 94c341a68baa\r\nStep 11 : ARG BUILD_DATE\r\n ---> Running in cc94c6e5412c\r\n ---> f3777cbd2b2c\r\nRemoving intermediate container cc94c6e5412c\r\nStep 12 : ARG BASE_SHA\r\n ---> Running in 01a9509d9d9a\r\n ---> 94bd7c0d2af0\r\nRemoving intermediate container 01a9509d9d9a\r\nStep 13 : ARG CREATED\r\n ---> Running in f6e49015e2a2\r\n ---> 32f96ac234a8\r\nRemoving intermediate container f6e49015e2a2\r\nStep 14 : ARG VENDOR\r\n ---> Running in c16888a5476e\r\n ---> 15881d74d012\r\nRemoving intermediate container c16888a5476e\r\nStep 15 : ARG VERSION\r\n ---> Running in 05cebf9acf03\r\n ---> a7fbac45da15\r\nRemoving intermediate container 05cebf9acf03\r\nStep 16 : LABEL com.docker.hub.base.version \"${VERSION:-UNKNOWN}\"\r\n ---> Running in 7e06250f73d5\r\n ---> 355006c391da\r\nRemoving intermediate container 7e06250f73d5\r\nStep 17 : LABEL com.docker.hub.base.image \"${VENDOR:-UNKNOWN}\"\r\n ---> Running in 8d37a6e826a7\r\n ---> f5a2962823b5\r\nRemoving intermediate container 8d37a6e826a7\r\nStep 18 : LABEL com.docker.hub.base.build-date \"${CREATED:-UNKNOWN}\"\r\n ---> Running in ab0be94badce\r\n ---> eb4441bd6cb3\r\nRemoving intermediate container ab0be94badce\r\nStep 19 : LABEL com.docker.hub.base.digest \"${BASE_SHA:-UNKNOWN}\"\r\n ---> Running in 7f07d5e2fa9a\r\n ---> 792394d36027\r\nRemoving intermediate container 7f07d5e2fa9a\r\nStep 20 : LABEL a \"${DOCKER_IMAGE:-my_img_name}\"\r\n ---> Running in 22658a934415\r\n ---> 662fb6169fb0\r\nRemoving intermediate container 22658a934415\r\nStep 21 : LABEL b \"${BUILDER_HOST:-UNKNOWN}\"\r\n ---> Running in 4b8ec79c5a5f\r\n ---> deac7842e72b\r\nRemoving intermediate container 4b8ec79c5a5f\r\nStep 22 : LABEL c \"${GIT_REPO:-git/my_git_repo}\"\r\n ---> Running in 28f0459195a9\r\n ---> f0c002382cf8\r\nRemoving intermediate container 28f0459195a9\r\nStep 23 : LABEL d \"${GIT_BRANCH:-UNKNOWN}\"\r\n ---> Running in 34d5f96496af\r\n ---> b0b1d534d4ef\r\nRemoving intermediate container 34d5f96496af\r\nStep 24 : LABEL f \"${GIT_HASH:-UNKNOWN}\"\r\n ---> Running in c1498cd739e5\r\n ---> d135a3f16e2d\r\nRemoving intermediate container c1498cd739e5\r\nStep 25 : LABEL g \"${DOCKER_TAG:-0.0.x}\"\r\n ---> Running in c248d76d5c81\r\n ---> ec4acba1e60a\r\nRemoving intermediate container c248d76d5c81\r\nStep 26 : LABEL h \"${BUILD_DATE:-UNKNOWN}\"\r\n ---> Running in 08801055ef6e\r\n ---> bcdd36987524\r\nRemoving intermediate container 08801055ef6e\r\nOne or more build-args [[BUILD_DATE [DOCKER_IMAGE [VERSION [http_proxy [https_proxy [BUILDER_HOST [CREATED [DOCKER_TAG [GIT_BRANCH [GIT_HASH [GIT_REPO [VENDOR [BASE_SHA] were not consumed, failing build.\r\n```\r\n\r\n\r\nThe output of this error should point exactly to the MISSING build-arg"},"comment":{"url":"https://api.github.com/repos/docker/docker/issues/comments/224542916","html_url":"https://github.com/docker/docker/issues/23308#issuecomment-224542916","issue_url":"https://api.github.com/repos/docker/docker/issues/23308","id":224542916,"user":{"login":"vdemeester","id":6508,"avatar_url":"https://avatars.githubusercontent.com/u/6508?v=3","gravatar_id":"","url":"https://api.github.com/users/vdemeester","html_url":"https://github.com/vdemeester","followers_url":"https://api.github.com/users/vdemeester/followers","following_url":"https://api.github.com/users/vdemeester/following{/other_user}","gists_url":"https://api.github.com/users/vdemeester/gists{/gist_id}","starred_url":"https://api.github.com/users/vdemeester/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vdemeester/subscriptions","organizations_url":"https://api.github.com/users/vdemeester/orgs","repos_url":"https://api.github.com/users/vdemeester/repos","events_url":"https://api.github.com/users/vdemeester/events{/privacy}","received_events_url":"https://api.github.com/users/vdemeester/received_events","type":"User","site_admin":false},"created_at":"2016-06-08T09:53:15Z","updated_at":"2016-06-08T09:53:15Z","body":"> One or more build-args [[BUILD_DATE [DOCKER_IMAGE [VERSION [http_proxy [https_proxy [BUILDER_HOST [CREATED [DOCKER_TAG [GIT_BRANCH [GIT_HASH [GIT_REPO [VENDOR [BASE_SHA] were not consumed, failing build.\r\n\r\nSomething is really weird here, all the `build-arg` the `docker build` reported are prepended with a `[`, probably why it fails on *all of them*.\r\n\r\nWith the following `Dockerfile`…\r\n\r\n```Dockerfile\r\nFROM busybox\r\n\r\nARG VERSION\r\nLABEL com.docker.hub.base.version=\"${VERSION:-MANUAL}\"\r\n```\r\n\r\n… this is some output examples :\r\n\r\n```bash\r\nλ docker build --build-arg VERSION -t test\r\nSending build context to Docker daemon 2.048 kB\r\nStep 1 : FROM busybox\r\n ---> 47bcc53f74dc\r\nStep 2 : ARG VERSION\r\n ---> Using cache\r\n ---> 3dfe425e7ef5\r\nStep 3 : LABEL com.docker.hub.base.version \"${VERSION:-MANUAL}\"\r\n ---> Using cache\r\n ---> 5f2cde124b1b\r\nSuccessfully built 5f2cde124b1b\r\n# […]\r\nλ docker build --build-arg FOO --build-arg BAR --build-arg VERSION -t test \r\nSending build context to Docker daemon 2.048 kB\r\nStep 1 : FROM busybox\r\n ---> 47bcc53f74dc\r\nStep 2 : ARG VERSION\r\n ---> Using cache\r\n ---> 3dfe425e7ef5\r\nStep 3 : LABEL com.docker.hub.base.version \"${VERSION:-MANUAL}\"\r\n ---> Using cache\r\n ---> 5f2cde124b1b\r\nOne or more build-args [BAR FOO] were not consumed, failing build.\r\n```\r\n\r\nAs @duglin said, it reports any `build-arg` specified using the cli but not consumed by the `Dockerfile`… So in your example, somehow, you specified it in some way (and in a way all of them were prepended with a `[`).\r\n"}}
{"actor":{"display_login":"vdemeester"}}