• 카테고리

    질문 & 답변
  • 세부 분야

    데브옵스 · 인프라

  • 해결 여부

    미해결

nginx 실습 질문이요

21.05.06 11:14 작성 조회수 178

1

/Users/imhyeonmin/index.html 파일을 만들었습니다. 그리고 다음 명령어를 입력했습니다.

docker run -d --rm \<o:p></o:p>

-p 50000:80 \<o:p></o:p>

-v $(/Users/imhyeonmin)/index.html:/usr/share/nginx/html/index.html \<o:p></o:p>

Nginx<o:p></o:p>

그러더니 

ad998364e67ff69914afc46365be9de56c6f448a0067794be1c4f2e192658ba1<o:p></o:p>

docker: Error response from daemon: Mounts denied:<o:p></o:p>

The path /index.html is not shared from the host and is not known to Docker.<o:p></o:p>

You can configure shared paths from Docker -> Preferences... -> Resources -> File Sharing.<o:p></o:p>

See https://docs.docker.com/docker-for-mac for more info.<o:p></o:p>

로그가 떠서 도커 환경설정에서 리소스 -> 파일 셰어링에서 /Users/imhyeonmin 을 추가했는데도 같은 에러 로그가 뜨네요...

그래서..명령어가 잘못되엇나 싶어서  다음 처럼 입력했더니

-v $(/Users/imhyeonmin/index.html):/usr/share/nginx/html/index.html \

/Users/imhyeonmin/index.html: line 3:<o:p></o:p>

hello world<o:p></o:p>

: command not found<o:p></o:p>

b07cd2892e4799fc2d8daec9ad64fd50c359d75ae737f86ecba6b4358ce66c0a<o:p></o:p>

커맨드 낫파운드가 뜨네요....뭘 잘못한건지 알려주세요..

답변 1

답변을 작성해보세요.

1

안녕하세요!

입력하신 명령어에서 변수부분이 잘못된것 같습니다.

다음과 같이 변경하고 테스트해보시겠어요?

입력)

-v $(/Users/imhyeonmin/index.html):/usr/share/nginx/html/index.html

수정)

-v /Users/imhyeonmin/index.html:/usr/share/nginx/html/index.html

감사합니다!