2019.04.23 - Bind Mounting, Persistent Data

a bind mount is just a mapping of the host files or directories, into a container file or directory.
basically just two locations pointing to the same file.
host files overwrite any in container, but doesn't change or overwrite just because of host file change.

can't use in dockerfile, must be at container run (run time)
ex ) . . . run -v //c/Users/Jun/stuff:/path/container (windows)
ex ) . . . run -v /Users/Jun/stuff:/path/container (mac/linux)


docker container run -d --name nginx -p 80:80 -v $(pwd):/usr/share/nginx/html nginx
* $(pwd) : shell script로 현재 디렉토리다.
* 뒤에 나오는 경로는 샘플 assignment의 경로이므로 고정이 아님.


* Udemy에 질문사항이 있어 현재 확인 중

댓글

이 블로그의 인기 게시물

로컬 Tomcat 서버 실행속도 개선

2019.05.23 - SQLAlchemy 의 객체 상태 관리 (expire, refresh, flush, commit) 에 관한 이해

방통대 컴퓨터과학과 2019-2학기 자료구조 수강 후기