docker-make throws erroneous WARNINGS in a repository that has no git tags applied
Attempting to run docker-make (latest version on dockerhub) emits errors if the repository being run against has never had any git tags applied to it. Even if the .docker-make.yaml file does not specify use of any tags.
docker-make also seems to be attempting to convert my last commit message to a tag erroneously. Perhaps as a result of this issue.
git describe --tags seems to only be called from:
https://github.com/CtripCloud/docker-make/blob/d392161262c8d8d9e97b9e2ac9013f19e4f851a5/dmake/template_args.py#L90
For info on why git returns this error please see: https://stackoverflow.com/a/5371322/3902629
$ git describe --tags
fatal: No names found, cannot describe anything.
$ make build
docker run --rm -w /usr/src/app -v ~/.docker:/root/.docker -v /var/run/docker.sock:/var/run/docker.sock -v "/Users/glenn/src/chainpoint/chainpoint-node-src":/usr/src/app jizhilong/docker-make:latest docker-make --no-push
WARNING dmake.template_args(101) 2017-10-08 19:27:59,960 3509d79 Upgrade request and request-promise-native is not a valid docker tag name,will be automatically corrected to 3509d79_Upgrade_request_and_request-promise-native
INFO dmake.template_args(59) 2017-10-08 19:28:00,032 failed to run git describe --tags: Command 'git describe --tags' returned non-zero exit status 128
WARNING dmake.template_args(101) 2017-10-08 19:28:00,080 3509d79 Upgrade request and request-promise-native is not a valid docker tag name,will be automatically corrected to 3509d79_Upgrade_request_and_request-promise-native
INFO dmake.template_args(59) 2017-10-08 19:28:00,153 failed to run git describe --tags: Command 'git describe --tags' returned non-zero exit status 128
INFO dmake.build(147) 2017-10-08 19:28:00,156 chainpoint-node: building
INFO dmake.build(147) 2017-10-08 19:28:02,295 chainpoint-node: attaching labels
INFO dmake.build(147) 2017-10-08 19:28:02,421 chainpoint-node: label added: org.chainpoint.git.commitid="3509d79cebab160eebc97b0ea600876cee1017e8"
INFO dmake.build(147) 2017-10-08 19:28:02,422 chainpoint-node: build succeed: 4ab850a176b0
INFO dmake.build(147) 2017-10-08 19:28:02,460 chainpoint-node: tag added: quay.io/chainpoint/chainpoint-node:3509d79cebab160eebc97b0ea600876cee1017e8
INFO dmake.build(147) 2017-10-08 19:28:02,487 chainpoint-node: tag added: quay.io/chainpoint/chainpoint-node:latest
.docker-make.yml:
builds:
chainpoint-node:
context: .
dockerfile: Dockerfile
pushes:
- 'always=quay.io/chainpoint/chainpoint-node:{fcommitid}'
- 'on_branch:master=quay.io/chainpoint/chainpoint-node:latest'
labels:
- 'org.chainpoint.git.commitid={fcommitid}'
dockerignore:
- .git
@grempe thanks for reporting this issue.
for the warning on failed git describe --tags invocations, I believe it should be fixed in #9 .
As you mentioned, the related commands should never get code if the template arg is not referenced by docker-make.yml, and I think a more appropriate way is to evaluate the value of tag template arguments lazily.
I don't think this is resolved. The merge you reference is from 7 months ago. I am seeing this issue continuing using Docker image jizhilong/docker-make:latest docker-make --no-push as shown in my full output above.