Bug 1478024

Summary: Unconsumed Build-Arg specification while building docker image
Product: Red Hat Enterprise Linux 7 Reporter: Suhaas Bhat <subhat>
Component: dockerAssignee: Antonio Murdaca <amurdaca>
Status: CLOSED CURRENTRELEASE QA Contact: atomic-bugs <atomic-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.3CC: amurdaca, dornelas, lsm5
Target Milestone: rcKeywords: Extras
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: docker-1.12.6-55.gitc4618fb.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-01-29 22:46:02 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1186913    

Description Suhaas Bhat 2017-08-03 13:17:06 UTC
Description of problem:

We need to specify build argument in a Docker file for building a docker image even if we don't consume it. It is resulting in unnecessary argument Declaration in every file.

Version-Release number of selected component (if applicable):

Red Hat Enterprise Linux 7.3
docker-1.12.6-48.git0fdc778.el7.x86_64


How reproducible:

Fully reproducible

Steps to Reproduce:

**********
-bash-4.2# docker build --build-arg VERSION=3.1.4 -t hello-error .
Sending build context to Docker daemon 530.4 kB
Step 1 : FROM rhel7:latest
 ---> f98706e16e41
Step 2 : USER root
 ---> Using cache
 ---> accce8f399a0
Step 3 : MAINTAINER Maintainer_Name
 ---> Using cache
 ---> 9694f64f09d6
Step 4 : EXPOSE 3306
 ---> Running in dfafc09d4a09
 ---> c1c31ffc6b0e
Removing intermediate container dfafc09d4a09
Step 5 : CMD --basedir=/usr
 ---> Running in be7e28c22080
 ---> 312d24038d17
Removing intermediate container be7e28c22080
One or more build-args [VERSION] were not consumed, failing build.
***********

Actual results:

One or more build-args [VERSION] were not consumed, failing build.

Expected results:

Should have given a warning.

Additional info:

This issue is not occurring for docker-latest package version 1.13.1 ( Just giving a warning )

Comment 2 Antonio Murdaca 2017-08-03 13:29:36 UTC
Backported https://github.com/projectatomic/docker/commit/c4618fb6bf4058dcde877f773cfd4afb5abe626c to docker-1.12.6