You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Feature Request: Let docker cp respect .dockerignore files #40925
I have a use-case, where I want to create (but not start) a container on a remote docker host, then use docker cp to copy files over the network into the container and then start the container. Basically a Dockerfile with FROM, COPY and a RUN, but that does not actually produce a container.
While a COPY instruction in a Dockerfile respects .dockerignore files, the docker cp command does not support this, resulting in copying a lot of unnecessary files.
Describe the results you received:
Files that are matched by .dockerignore files are still being copied.
Describe the results you expected:
Files that are matched by .dockerignore files are not copied.
Additional information you deem important (e.g. issue happens only occasionally):
For backwards compatibility this should probably require a flag like --use-ignore or so.
Output of docker version:
Client:
Version: 19.03.8-ce
API version: 1.40
Go version: go1.14.1
Git commit: afacb8b7f0
Built: Thu Apr 2 00:04:36 2020
OS/Arch: linux/amd64
Experimental: false
Server: Docker Engine - Community
Engine:
Version: 19.03.8
API version: 1.40 (minimum version 1.12)
Go version: go1.12.17
Git commit: afacb8b7f0
Built: Wed Mar 11 01:24:28 2020
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.2.13
GitCommit: 7ad184331fa3e55e52b890ea95e65ba581ae3429
runc:
Version: 1.0.0-rc10
GitCommit: dc9208a3303feef5b3839f4323d9beb36df0a9dd
docker-init:
Version: 0.18.0
GitCommit: fec3683
Reacted by Marcelo Briones, Max Schmitt, Quan TRAN, satanTime, roman-konopski-webini, Benoît COUETIL, Michał, AndresPerez, Matthias Kunnen, Dmitry Kozlov and 12 more
My use case is in devops testing code inside a container. The environment takes a long time to build, I would like to copy the code directory at runtime, ignoring files in the .dockerignore list.
Activity
margori commentedon May 18, 2020
I confirm. I have same expectation
docker cpshould respect.dockerignorefileMadhur1997 commentedon Jun 21, 2020
I would like to work on this
itscaro commentedon Sep 29, 2020
I have the same use-case. Building a new image to use COPY is less fit for my use-case.
andregeert commentedon Oct 27, 2020
My use case is in devops testing code inside a container. The environment takes a long time to build, I would like to copy the code directory at runtime, ignoring files in the
.dockerignorelist.kddsultan commentedon Mar 7, 2024
Does anyone know this is still the case?