I am going to copy a file named a.py to the home/dir1 directory in the container. If you want to verify that the files have been copied successfully, you can enter your container in the following manner and then use regular Linux commands: docker exec -it ubu_container bashĬopy files from host system to docker containerĬopying with docker cp is similar to the copy command in Linux. In my case, the docker container name is ubu_container. You need to know either the container ID or the container name. List your running containers first using docker ps command: sudo docker psĬONTAINER ID IMAGE COMMAND CREATED STATUSĨ353c6f43fba 775349758637 "bash" 8 seconds ago Up 7 If you want to copy files from your host system to the container, you should use docker cp command like this: docker cp host_source_path container:destination_path Docker cp command is a handy utility that allows to copy files and folders between a container and the host system.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |