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

repo2docker.ref contains HEAD rather than the actual commit ID at the time of creation #1324

Open
sgaist opened this issue Dec 13, 2023 · 1 comment

Comments

@sgaist
Copy link
Contributor

sgaist commented Dec 13, 2023

Bug description

When creating an image, if HEAD is used, then the repo2docker.ref label will contain that value which is not really useful. One must start a container and use git to know which commit was used to build the container.

The same goes if --ref is not used, then the ref will be None

Expected behaviour

When HEAD is used, the commit hash should be put it in repo2docker.ref.
Same goes if --ref is not used.

Actual behaviour

repo2docker.ref contains the literal HEAD when --ref HEAD is used.
repo2docker.ref contains the literal None when --ref is not used.

How to reproduce

  1. clone a repo2docker repository
  2. run repo2docker --no-run --no-push --image-name label-test .
  3. docker image inspect label-test -f '{{ index .Config.Labels "repo2docker.ref" }}'
  4. See None

Your personal set up

  • OS: [linux, OSX]
  • Docker version: Docker Desktop 4.25.1 (128006)
  • repo2docker version: 2023.06.0+47.g1bb3cba (development installation)
@sgaist
Copy link
Contributor Author

sgaist commented Dec 22, 2023

After having done some testing and gone through the ContentProviders subclasses, I am wondering whether repo2dock.ref should simply contain the value returned by content_id ?

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