작성
·
233
1
/Users/imhyeonmin/index.html 파일을 만들었습니다. 그리고 다음 명령어를 입력했습니다.
docker run -d --rm \
-p 50000:80 \
-v $(/Users/imhyeonmin)/index.html:/usr/share/nginx/html/index.html \
Nginx
그러더니
ad998364e67ff69914afc46365be9de56c6f448a0067794be1c4f2e192658ba1
docker: Error response from daemon: Mounts denied:
The path /index.html is not shared from the host and is not known to Docker.
You can configure shared paths from Docker -> Preferences... -> Resources -> File Sharing.
See https://docs.docker.com/docker-for-mac for more info.
로그가 떠서 도커 환경설정에서 리소스 -> 파일 셰어링에서 /Users/imhyeonmin 을 추가했는데도 같은 에러 로그가 뜨네요...
그래서..명령어가 잘못되엇나 싶어서 다음 처럼 입력했더니
-v $(/Users/imhyeonmin/index.html):/usr/share/nginx/html/index.html \
/Users/imhyeonmin/index.html: line 3:
hello world
: command not found
b07cd2892e4799fc2d8daec9ad64fd50c359d75ae737f86ecba6b4358ce66c0a
커맨드 낫파운드가 뜨네요....뭘 잘못한건지 알려주세요..
답변 1
1
안녕하세요!
입력하신 명령어에서 변수부분이 잘못된것 같습니다.
다음과 같이 변경하고 테스트해보시겠어요?
입력)
-v $(/Users/imhyeonmin/index.html):/usr/share/nginx/html/index.html
수정)
-v /Users/imhyeonmin/index.html:/usr/share/nginx/html/index.html
감사합니다!