Docker, k8s
[Docker] Docker cp : host 에서 Container 로 file copy
bryan.oh
2020. 3. 27. 01:04
반응형
host , docker container file copy
host filesystem 에서 docker 의 container 에 file 을 copy 하고 싶을 때
1. host -> docker container
- test file 생성
- docker cp [hostFilePath] [container_name]:[containerPath]
- container 에서 확인
2. docker container -> host
- container 에서 test file 생성 test2.txt
- docker cp [container_name]:[containerFilePath] [host_name]
- host 에서 확인
> dir /w # 윈도우에서 dir 확인
(참고)
exit 로 나온걸 보면 아시겠지만 container 가 실행중이지 않아도 copy 는 가능합니다.
folder도 copy 할 수 있습니다.
728x90
반응형