-
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
COPY ./.git X
command errors in buildx v0.13.1
#4777
Comments
dhedey
changed the title
COPY of
Mar 18, 2024
./.git
folder now errorsCOPY ./.git X
command now errors
dhedey
changed the title
Mar 18, 2024
COPY ./.git X
command now errorsCOPY ./.git X
command now errors in buildx v0.13.1
dhedey
changed the title
Mar 18, 2024
COPY ./.git X
command now errors in buildx v0.13.1
COPY ./.git X
command errors in buildx v0.13.1
I don't think the above fixes it in general. we have a build context with an absolute path ( $ cat Dockerfile
FROM alpine
COPY --from=src file / this still breaks. it used to work in docker 24.0.5:
but in docker 24.0.9 and 25.0.3,
the fix in eb41916 only works if the path starts with |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Summary
Until a recent upgrade, a command such as
COPY ./.git /build-dir/.git
was working fine. It's perhaps a little questionable copying a git folder into a docker image, but we were using it for builds, and our build script reads tag information from the git directory - so it's certainly defensible.Now it errors with:
Using
Likely cause
I believe this relates to #4142 - although I'm not sure why we've only just seen the issue now. Maybe it's taken a while for the release to hit our CI server, or maybe there's some other more recent update which has triggered this code path.
Specifically:
./.git
converted tohttps://./.git
https://./.git
be interpreted as a valid git reference.I think the fallback assumption that a path is
https://
is too excessive. Basically any path ending.git
would hit this issue.As a workaround in our case, we might be able to do something like this:
COPY ./.git/* /build-dir/.git/
but I still need to test this (cf moby/moby#15771)The text was updated successfully, but these errors were encountered: