Docker Copying file from host to container

后端 未结 2 1091
情深已故
情深已故 2021-01-18 05:41

I am trying to copy a set of files from docker host to container. On a AUFS system directly going into /var/lib/docker/aufs/... works. However I am another system with Fedor

2条回答
  •  醉话见心
    2021-01-18 06:30

    This answer provides you a different view of copying.

    1> Use this way provided you know the IP of the container. If your aim is just to take the files form the host system and put it in the container you can do it using different ways. File transfer protocol is a easier way. you can setup an SSH server(sshd) on your docker container and use scp or any other file transfer tools to do it.

    2> Sharing files via volumes using this command docker run -ti -v /host-path-of-directory-having-files/:/target-path-in-container/:rw image-name bash. You can refer this link https://docs.docker.com/userguide/dockervolumes/

提交回复
热议问题