Bug 1375436

Summary: 'docker version' command displays incorrect Git commit information
Product: Red Hat Enterprise Linux 7 Reporter: Akihiro Matsushima <akihiro.matsushima>
Component: dockerAssignee: Lokesh Mandvekar <lsm5>
Status: CLOSED CURRENTRELEASE QA Contact: atomic-bugs <atomic-bugs>
Severity: low Docs Contact:
Priority: unspecified    
Version: 7.2CC: amurdaca, dwalsh, lsm5
Target Milestone: rcKeywords: Extras
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-06-30 14:57:25 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:

Description Akihiro Matsushima 2016-09-13 06:48:59 UTC
Description of problem:
The 'docker version' command displays incorrect Git commit information because you have used %autosetup macro with '-S git' in the spec file lately.

Version-Release number of selected component (if applicable):
docker-1.10.3-46.el7.10.x86_64

How reproducible:
always

Steps to Reproduce:
1. yum install --enablerepo=rhel-7-server-extras-rpms docker
2. systemctl start docker.service
3. docker version

Actual results:
$ docker version
Client:
 Version:         1.10.3
 API version:     1.22
 Package version: docker-common-1.10.3-46.el7.10.x86_64
 Go version:      go1.6.2
 Git commit:      2a93377-unsupported
 Built:           Fri Jul 29 13:45:25 2016
 OS/Arch:         linux/amd64

Server:
 Version:         1.10.3
 API version:     1.22
 Package version: docker-common-1.10.3-46.el7.10.x86_64
 Go version:      go1.6.2
 Git commit:      2a93377-unsupported
 Built:           Fri Jul 29 13:45:25 2016
 OS/Arch:         linux/amd64

Expected results:
$ docker version
Client:
 Version:         1.10.3
 API version:     1.22
 Package version: docker-common-1.10.3-46.el7.10.x86_64
 Go version:      go1.6.2
 Git commit:      f9d4a2c/1.10.3
 Built:           Fri Jul 29 13:45:25 2016
 OS/Arch:         linux/amd64

Server:
 Version:         1.10.3
 API version:     1.22
 Package version: docker-common-1.10.3-46.el7.10.x86_64
 Go version:      go1.6.2
 Git commit:      f9d4a2c/1.10.3
 Built:           Fri Jul 29 13:45:25 2016
 OS/Arch:         linux/amd64


Additional info:
If you intend to use DOCKER_GITCOMMIT then you should not initialize git repository.

Please refer to
https://github.com/projectatomic/docker/blob/rhel7-1.10.3/hack/make.sh#L69-L80
https://github.com/docker/docker/blob/master/hack/make.sh#L81-L100

Comment 2 Daniel Walsh 2016-09-13 12:25:53 UTC
Lokesh could you look into this?