{"action":"created","issue":{"url":"https://api.github.com/repos/docker/docker/issues/26249","repository_url":"https://api.github.com/repos/docker/docker","labels_url":"https://api.github.com/repos/docker/docker/issues/26249/labels{/name}","comments_url":"https://api.github.com/repos/docker/docker/issues/26249/comments","events_url":"https://api.github.com/repos/docker/docker/issues/26249/events","html_url":"https://github.com/docker/docker/issues/26249","id":174535831,"number":26249,"title":"Unconsumed build-arg should not fail docker build","user":{"login":"rzachariah","id":4552543,"avatar_url":"https://avatars.githubusercontent.com/u/4552543?v=3","gravatar_id":"","url":"https://api.github.com/users/rzachariah","html_url":"https://github.com/rzachariah","followers_url":"https://api.github.com/users/rzachariah/followers","following_url":"https://api.github.com/users/rzachariah/following{/other_user}","gists_url":"https://api.github.com/users/rzachariah/gists{/gist_id}","starred_url":"https://api.github.com/users/rzachariah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rzachariah/subscriptions","organizations_url":"https://api.github.com/users/rzachariah/orgs","repos_url":"https://api.github.com/users/rzachariah/repos","events_url":"https://api.github.com/users/rzachariah/events{/privacy}","received_events_url":"https://api.github.com/users/rzachariah/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/docker/docker/labels/area/builder","name":"area/builder","color":"fbca04"},{"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.11","name":"version/1.11","color":"ededed"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2016-09-01T14:18:13Z","updated_at":"2016-10-03T14:41:22Z","closed_at":null,"body":"---------------------------------------------------\r\nBUG REPORT INFORMATION\r\n---------------------------------------------------\r\n**Output of `docker version`:**\r\n```\r\nClient:\r\n Version:      1.11.2\r\n API version:  1.23\r\n Go version:   go1.5.4\r\n Git commit:   b9f10c9\r\n Built:        Wed Jun  1 21:47:50 2016\r\n OS/Arch:      linux/amd64\r\n\r\nServer:\r\n Version:      1.11.2\r\n API version:  1.23\r\n Go version:   go1.5.4\r\n Git commit:   b9f10c9\r\n Built:        Wed Jun  1 21:47:50 2016\r\n OS/Arch:      linux/amd64\r\n```\r\n\r\n**Output of `docker info`:**\r\n```\r\nContainers: 0\r\n Running: 0\r\n Paused: 0\r\n Stopped: 0\r\nImages: 24\r\nServer Version: 1.11.2\r\nStorage Driver: aufs\r\n Root Dir: /var/lib/docker/aufs\r\n Backing Filesystem: extfs\r\n Dirs: 29\r\n Dirperm1 Supported: true\r\nLogging Driver: json-file\r\nCgroup Driver: cgroupfs\r\nPlugins:\r\n Volume: local\r\n Network: bridge null host\r\nKernel Version: 3.16.0-30-generic\r\nOperating System: Ubuntu 14.04.2 LTS\r\nOSType: linux\r\nArchitecture: x86_64\r\nCPUs: 1\r\nTotal Memory: 1.955 GiB\r\nName: localhost\r\nID: WLEB:43M4:CAE3:SKQF:5SMS:EFWL:JRJF:S3O7:D2AC:S6ZO:R3M3:SDYC\r\nDocker Root Dir: /var/lib/docker\r\nDebug mode (client): false\r\nDebug mode (server): false\r\nUsername: rzachariah\r\nRegistry: https://index.docker.io/v1/\r\nWARNING: No swap limit support\r\n```\r\n\r\nVirtualBox VM running on Windows 7 machine. Accessed via Vagrant.\r\n\r\n**Steps to reproduce the issue:**\r\n1. Create a valid Dockerfile (in my case, for a node service). DO NOT consume the build-arg we will pass in next.\r\n2. Build the docker image passing in an unused build-arg\r\ndocker build --build-arg VERSION=3.1.4 -t hello-error .\r\n\r\n**Describe the results you received:**\r\nDocker build fails with this error:\r\nStep 11 : EXPOSE 80\r\n ---> Using cache\r\n ---> aed38f6ddf88\r\nStep 12 : CMD npm start\r\n ---> Using cache\r\n ---> c33d33264d01\r\nOne or more build-args [VERSION] were not consumed, failing build.\r\n\r\n**Describe the results you expected:**\r\nBuild should succeed.\r\n\r\n**Additional information you deem important (e.g. issue happens only occasionally):**\r\nI think it makes more sense for build-args to be optional. We have a CI build script that runs the docker build command. It's shared across our org. Not everyone needs the variable we pass in."},"comment":{"url":"https://api.github.com/repos/docker/docker/issues/comments/251124027","html_url":"https://github.com/docker/docker/issues/26249#issuecomment-251124027","issue_url":"https://api.github.com/repos/docker/docker/issues/26249","id":251124027,"user":{"login":"mgomezch","id":774845,"avatar_url":"https://avatars.githubusercontent.com/u/774845?v=3","gravatar_id":"","url":"https://api.github.com/users/mgomezch","html_url":"https://github.com/mgomezch","followers_url":"https://api.github.com/users/mgomezch/followers","following_url":"https://api.github.com/users/mgomezch/following{/other_user}","gists_url":"https://api.github.com/users/mgomezch/gists{/gist_id}","starred_url":"https://api.github.com/users/mgomezch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgomezch/subscriptions","organizations_url":"https://api.github.com/users/mgomezch/orgs","repos_url":"https://api.github.com/users/mgomezch/repos","events_url":"https://api.github.com/users/mgomezch/events{/privacy}","received_events_url":"https://api.github.com/users/mgomezch/received_events","type":"User","site_admin":false},"created_at":"2016-10-03T14:41:22Z","updated_at":"2016-10-03T14:41:22Z","body":"I meant this feature, though:\r\n\r\n> Not requiring ARG would result in any environment variable to be set in the image during build, which is not the same\r\n\r\nIt’d be nice to be able to specify build environment variables using `--build-arg` for variables not specified in the `Dockerfile`, and have them consumed and applied to the environment made available to commands in `RUN` instructions during the build.  My use case would be the same as that specified in [the aforementioned comment in #14634](https://github.com/docker/docker/issues/14634#issuecomment-230976732).  Indeed this would be useful to access cached resources during builds in CI infrastructure for build systems that don’t use the “standard” variables that have been included in [BuiltinAllowedBuildArgs](https://github.com/docker/docker/blob/7944480dd0dfb00323f960d37c31d0ddad5f6cf2/builder/dockerfile/builder.go#L37-L47).\r\n\r\nI understand this issue as specific to the feature of yielding only a warning, not a build failure, if the build command is provided a `--build-arg` option that does not match an `ARG` instruction in the built `Dockerfile`, but this issue falls short of requesting that such `--build-arg` options produce environment variables available to `RUN` instruction commands.  Or does this issue cover both features?"}}
{"actor":{"display_login":"mgomezch"}}