chore: Add /.git/ to the container build context#203
Open
apljungquist wants to merge 3 commits intoAxisCommunications:mainfrom
Open
chore: Add /.git/ to the container build context#203apljungquist wants to merge 3 commits intoAxisCommunications:mainfrom
/.git/ to the container build context#203apljungquist wants to merge 3 commits intoAxisCommunications:mainfrom
Conversation
Without it the `version_with_commit_id` macro cannot infer what commit the developer tools are installed from. The purpose of having this information is "to make it possible for users to communicate what version of the programs they are using when they experience issues" (AxisCommunications#137). Drawback of adding the git directory to the container build context include: - Worse cache performance (if memory serves any file changes to the mounted tree will invalidate that step in the dockerfile). But since this is the last step and I don't usually rebuild the dev container unless I expect something to be different, I don't think this will be an issue. - The resulting environment could in theory be the function of information not in the current commit or one of its ancestors. The likelihood and impact of this are both low and I think the benefit of the improved troubleshooting far outweighs the risk.
apljungquist
added a commit
that referenced
this pull request
Jul 17, 2025
This is needed to use the run and test commands from `cargo-acap-sdk` with the Virtual Loan Tool, which uses port mapping to make multiple cameras available at one (or possibly a small number) of IP addresses. Ideally, we would only bump them when we do a release, but we don't do proper releases, and I still want to be able to ask users what version they are on when helping them to troubleshoot. The need for aggressive version bumping will hopefully be eliminated with the merging of #203.
guoxe
reviewed
Sep 15, 2025
| @@ -1,5 +1,6 @@ | |||
| * | |||
| !/.devhost/ | |||
| !/.git/ | |||
Contributor
There was a problem hiding this comment.
Would bind mounting this be an option?
Collaborator
Author
There was a problem hiding this comment.
Are you suggesting that if we bind mount ./.git/ explicitly in addition to ./, then we would not need to add it to the .dockerignore?
If it works, then it's an option. Curious what you see as benefits though?
Collaborator
Author
There was a problem hiding this comment.
Context: this is where the existing bind mount, which excludes .git/, happens: https://github.com/AxisCommunications/acap-rs/blob/main/.devcontainer/Dockerfile#L57
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Without it the
version_with_commit_idmacro cannot infer what commit the developer tools are installed from. The purpose of having this information is "to make it possible for users to communicate what version of the programs they are using when they experience issues" (#137).Drawback of adding the git directory to the container build context include: