Questions tagged [docker-cp]

16 questions
6
votes
3 answers

Ansible docker module missing CP command?

The docker client offers the cp sub-command as explained here, which is very handy when one needs to copy a file into a container (note: this is somewhat analogous to Dockerfile ADD instruction in image building). In Docker 1.8 the cp command has…
Hristo Stoyanov
  • 1,508
  • 3
  • 15
  • 24
4
votes
0 answers

How to copy entire folder from local machine to Amazon Sagemaker or vice-versa?

I want to copy a folders/files from my local machine (MAC) to the docker container in Amazon Sagemaker . I tried using scp commands to copy from local to sagemaker, for folder scp -r -i
Eyshika
  • 1,041
  • 1
  • 11
  • 18
2
votes
1 answer

Can't use docker cp to copy file from /tmp

When using docker cp to move files from my local machine /tmp/data.txt to the container, it fails with the error: lstat /tmp/data.txt: no such file or directory The file exists and I can run stat /tmp/data.txt and cat /tmp/data.txt without any…
Daniel
  • 10,641
  • 12
  • 47
  • 85
2
votes
2 answers

Docker cp parameter expansion in powershell

I would like to run something like this: $docker_container_name = "iar_build_container" ... $cp_arguments = $docker_container_name + ":C:/docker_work/IAR/Debug " + $docker_artifacts + "/Debug" "Copying out the build artifacts:…
Nick
  • 1,361
  • 1
  • 14
  • 42
2
votes
0 answers

How to push a shared volume or shared image to ECR

Right now I have this in a Dockerfile: ENV NLTK_DATA /nltk_data RUN python3 -m nltk.downloader -d /nltk_data all this Python library has several gigs of data. I don't know need an extra 5 GBs in each Docker image I publish to Amazon ECR. Is there…
Alexander Mills
  • 90,741
  • 139
  • 482
  • 817
1
vote
0 answers

Docker cp command does not delete unshared files when replacing directory in container

I am running an analysis in a Docker container that emulates the CERN remote server lxplus. After making changes within the container, I need to copy a specific file from the container to a local Git repository, then push it to a remote GitLab…
1
vote
1 answer

Copy file to docker container via Ansible

I want to copy a file to a docker container, as one of my Ansible playbook steps. I create the file with jinja2 "template". I can copy the file in /tmp/ and the run a command to copy it to the docker container, such as: `docker cp /tmp/config.json…
Ali
  • 337
  • 1
  • 5
  • 15
1
vote
1 answer

Copying files from docker container to the host fails

I'm using sitespeed to test our website. But the reports were generated in the docker container, but not on the host. So, I'm trying to use docker cp to get the reports. I can view the reports in the folder by executing the command: docker exec…
William Tu
  • 11
  • 1
1
vote
1 answer

Copy .txt files from docker container to host

So I have a docker container with .txt and .csv files in it. I need to copy these to host. But I only need to copy files .txt files. The command sudo docker cp -a env1_1:/path/*.txt . does not seem to work. Is copying files of a specific types…
Jishan
  • 1,654
  • 4
  • 28
  • 62
0
votes
1 answer

Is there a way to copy the contents of the directory into the Docker container?

Pretty much the title says it all. I know I can copy the file (from the host) into a docker container. I also know I can copy the directory into a docker container. But how to copy the contents of a directory (preserving all subdirectories) into a…
0
votes
1 answer

How can I check for directory existence before docker cp in jenkins pipeline

In my pipeline, I run testcases in the docker container then I copy some directories from the docker container to the Jenkins workspace. It isn't necessary that all directories will exist in the docker container (for example screenshot dir may…
Mona101ma
  • 675
  • 2
  • 7
  • 25
0
votes
2 answers

'Docker cp' with parameter expansion (PowerShell)

I want to copy a directory into a docker container, which is only defined by a certain query. I tried this: docker cp ../from-here/. $(docker ps -aqf "name=my-ending$"):/to-here Unforunately this throws this error: "docker cp" requires exactly 2…
0
votes
1 answer

Docker cp containers in a swarm?

I'm learning my way around swarm mode at this point, and normally when wanting to copy files to and from a container in non-swarm mode I would just do something like the following, to copy a file to a container named "swag": docker cp…
J. Scott Elblein
  • 4,013
  • 15
  • 58
  • 94
0
votes
1 answer

How can I stop docker from truncating long filenames when I copy from a container?

I've noticed that my tar.gz files that are getting uploaded have files inside them that have truncated filenames. When I view the build log, the files are getting written with the full filename (same outcome when building locally). The files are…
Buns of Aluminum
  • 2,439
  • 3
  • 26
  • 44
0
votes
1 answer

Sending files from one docker container to another

As the title states. I am looking to send a file from container A to container B. Both containers are running on separate volumes and are on the same network. Is this possible without temporarily storing the file in the host file system? I have been…
1
2