Getting error while running ./gradlew build command

Document ID : KB000046372
Last Modified Date : 14/02/2018
Show Technical Document Details

Question: 

We are getting  the below error while running ./gradlew build command

* What went wrong:

Execution failed for task ':dockerimages/devtest-jre:dockerImage'.

> Docker execution failed

Command line [docker tag -f devtest/devtest-jre:9.5.1.6 devtest/devtest-jre:latest] returned:

unknown shorthand flag: 'f' in -f

See 'docker tag --help'.

Environment:  

RedHat Linux 7.0 version

Docker tag v1.12.0

DEVTEST 9.1, 9.5

Analysis/Findings: 

This is a known issue with  Docker version 1.12.0 .

-f flag on docker tag is Deprecated In Release: v1.10.0 
Removed In Release: v1.12.0 

https://docs.docker.com/engine/deprecated/ 

It is not longer necessary to specify -f to move a tag from one image to another.

Nor will docker generate an error if the -f flag is missing and the specified tag is already in use.

Workaround: 

Please modify the .groovy file as shown below. 

Go to DEVTEST-HOME/docker/ buildSrc/src/main/groovy/com/ca/devtest/docker/NativeDockerClientEx.groovy

line 22 , change

def cmdLine = "${binary} tag -f ${tag} ${newTag}"

remove the -f

def cmdLine = "${binary} tag ${tag} ${newTag}"


Run the ./gradlew build command again.