Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build/versioning issue with docker-compose setup #1122

Open
sigrlami opened this issue Feb 20, 2021 · 1 comment
Open

build/versioning issue with docker-compose setup #1122

sigrlami opened this issue Feb 20, 2021 · 1 comment

Comments

@sigrlami
Copy link

sigrlami commented Feb 20, 2021

When building from sources in docker-compose it fails to properly resolve git tags and attach correct version value; this happened due to this change https://github.com/FactomProject/factomd/blame/328a1ea51a992ed2b58e1ad7d9043b2d9a9457b8/Makefile#L1 and not noticeable if the image built locally or on CI with direct access to git.

Docker context functionality just gets a folder with the source without any additional information from git, so simple setup like

version: "3"
services:
##################################################################################
    factomd:
	build:
            context: https://github.com/FactomProject/factomd.git
            dockerfile: Dockerfile.alpine

lead to an error while make install

Step 5/14 : RUN make install
 ---> Running in a234e9ef8600
fatal: No names found, cannot describe anything.
Make factomd 
fatal: No names found, cannot describe anything.

which is correct since no git data available. This can be solved if at least the latest tag exists in context before make inside Dockerfile but doing

RUN git fetch --unshallow

quite time-consuming, and probably not the best option here. So there are 2 options, avoid using git describe on top of make file or extend Dockerfile to fetch git data.

I'm not sure how that affects the build pipeline for CI and images but I can create a patch.

@sigrlami sigrlami changed the title Versioning issue with docker-compose setup build/versioning issue with docker-compose setup Feb 20, 2021
@sigrlami
Copy link
Author

Also, affects develop branch when someone runs an isolated build for whatever development reasons within docker-compose and raw git build, as tags not there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant