Docker Version 25.0.2 > Docker CP fails when copying to symlink dir
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
COPY --link=false/true also does not help. See @https://docs.docker.com/engine/reference/builder/#copy
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.
Closing per the above, but if "previous docker versions" were not using BuildKit, it could be a difference between buildkit and the legacy builder.