Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Copy all files with given extension from docker container

Tags:

docker

I'm have a running docker container with some files in some folder. Some of this files have ".jar" extension. I'm trying to copy it on localhost.

docker cp aaaaaaa:/opt/some/path/in/docker/folder/*.jar  /mnt/lib/

But I've got error.

Error response from daemon: lstat /var/lib/docker/devicemapper/mnt/bbbbbbbb/rootfs/opt/some/path/in/docker/folder/*.jar: no such file or directory What should i do to copy all files from folder in docker to localhost?

like image 662
nick_gabpe Avatar asked Oct 17 '22 21:10

nick_gabpe


1 Answers

COPY /root/local_folder/*.file_extension /root/destination_folder/

COPY ["file1.extension", "file2.extension"..., "fileX.extension"] /root/destination_folder/

This how we can copy all the files (according to the extension) form host machine to Docker file.

like image 88
Sivananda Avatar answered Oct 21 '22 05:10

Sivananda