for-linux icon indicating copy to clipboard operation
for-linux copied to clipboard

Docker Version 25.0.2 > Docker CP fails when copying to symlink dir

Open benjhess opened this issue 1 year ago • 2 comments

Docker CP fails when copying from a directory to a symlinked directory. This worked in previous docker versions. Example Dockerfile:

FROM debian:bullseye-slim
RUN mkdir -p /ldd/lib64/
RUN touch /ldd/lib64/hello-world

FROM busybox:1.34.1-glibc
COPY --from=0 /ldd/ /
# fails because of symlinked dir: /lib64 > /lib

ERROR: failed to solve: cannot copy to non-directory: /var/lib/docker/overlay2/nv6lwim79ddrm5h1awpx11qb0/merged/lib64

benjhess avatar Feb 03 '24 16:02 benjhess

COPY --link=false/true also does not help. See @https://docs.docker.com/engine/reference/builder/#copy

benjhess avatar Feb 03 '24 16:02 benjhess

This doesn't seem a regression in v25.0.2.

It doesn't work with v24.0.9, v23.0.6, and v20.10.24, either.

AkihiroSuda avatar Feb 14 '24 06:02 AkihiroSuda

Closing per the above, but if "previous docker versions" were not using BuildKit, it could be a difference between buildkit and the legacy builder.

thaJeztah avatar Jun 17 '24 12:06 thaJeztah