fix: Remove .dockerignore to give clean working tree during Docker build #1569
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.
Description
Resolves #1500
Remove the
.dockerignore
filepyhf/.dockerignore
Lines 1 to 12 in ce2ffab
from the project as during the Docker build of the image the
COPY
step to get the source code inpyhf/docker/Dockerfile
Line 8 in ce2ffab
will NOT copy over all files in the repo, which from Git's perspective means the files are missing and puts the Git working tree in a dirty state.
setuptools_scm
views a dirty working tree as a dev release, so even thoughpyhf
is being installed throughpip
locally on a release tagpyhf/docker/Dockerfile
Line 19 in ce2ffab
setuptools_scm
thinks it is a dev release and tags it as a dev release of the next patch release (e.g.,0.6.3.dev0
instead of0.6.2
). Removing the.dockerignore
file from the project resolves this.Removing the file actually has no effect on the built Docker images as the Docker build is multistage. The
COPY
step happens in the first stage, but the second stage that actually gets published just copies over the Python virtual environment in the Docker image which ignores all non-installable filespyhf/docker/Dockerfile
Lines 22 to 30 in ce2ffab
So we can remove the file without repercussions.
Checklist Before Requesting Reviewer
Before Merging
For the PR Assignees: