-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
ADD
with git repo url and --keep-git-dir
is left in detached HEAD state
#4446
Comments
After performing the git checkout, buildkit doesn't keep the https://docs.docker.com/engine/reference/builder/#adding-a-git-repository-add-git-ref-dir That should resolve your issue 🎉 |
Hi, please reopen and read the provided dockerfile where I used this flag already and demonstrated that the checkout is not happening. |
Under the |
Apologies @tspearconquest, I read through too quickly ❤️ @tonistiigi is there a reason we couldn't swap from Lines 542 to 545 in f893790
Or is there a deliberate reason we should be in a detached HEAD state? |
ADD
with git repo url does not set the branch?ADD
with git repo url and --keep-git-dir
is left in detached HEAD state
@jedevc Ref does not need to mean branch, |
Hi,
I'm trying to build Zed Attack Proxy inside a docker container.
My dockerfile is as follows:
Built with:
DOCKER_BUILDKIT=1 docker build --progress=plain --build-arg BUILDER_VERSION=11.0.21_9 --build-arg BUILDER_TYPE="-jdk-alpine" --build-arg PACKAGE_VERSION=v2.14.0 --build-arg IMAGE_VERSION=stable -t zaproxy:test .
This results in buildkit running
git branch
during the build and showing that themain
branch has been cloned but not checked out, so we're not sitting on any branch. I would have expected for the main branch to be checked out.Unfortunately, the fact that no branch was checked out breaks the gradle build of the addons, because it depends on being on a checked-out branch. Thus, when you remove the debugging commands and build, the following is output:
I looked through the docs but did not find any method to make buildkit
ADD
do a checkout after cloning the main branch. Is this a bug or by design? If by design, can support be added, possibly with another flag like--checkout=<true|false>
where the default is false?The text was updated successfully, but these errors were encountered: