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에 질문사항이 있어 현재 확인 중
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에 질문사항이 있어 현재 확인 중
댓글
댓글 쓰기