| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | ||||
| 4 | 5 | 6 | 7 | 8 | 9 | 10 |
| 11 | 12 | 13 | 14 | 15 | 16 | 17 |
| 18 | 19 | 20 | 21 | 22 | 23 | 24 |
| 25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- Python
- nginx
- git
- BOJ
- loop
- Clone
- TypeScript
- leetcode
- npm
- bash
- C#
- property
- JavaScript
- 앙상블
- condition
- vuetify
- vue.js
- VUE
- C++
- generic
- type
- var
- dotenv
- docker
- security
- AI
- machine learning
- 보안
- webpack
- scss
Archives
- Today
- Total
ice rabbit programming
[Docker][이슈] Are you trying to mount a directory onto a file (or vice-versa)? check if the specified host path exists and is the expected type. 에러 발생 본문
Development/Infra
[Docker][이슈] Are you trying to mount a directory onto a file (or vice-versa)? check if the specified host path exists and is the expected type. 에러 발생
판교토끼 2021. 5. 7. 21:06728x90
docker run을 할 때 -v 옵션을 주어 volume을 줄 수 있다. 그런데 자꾸 이런 에러가 발생할 때가 있다.
Are you trying to mount a directory onto a file (or vice-versa)? check if the specified host path exists and is the expected type.
근본적으로는 이것은 -v로 넘겨주는 것이 파일이 아니라 디렉토리라 발생하는 에러이다. 아마 이 에러를 검색해서 들어오신 분은 volume으로 넘겨주는 파일명을 잘못(오타를 냈거나 잘못 지정했거나) 적었을 확률이 크다. 만약 넘겨주는 파일명이 존재하지 않으면, 자동으로 mkdir이 된 후에 docker run이 실행되기 때문에.. 엉뚱한 위와 같은 에러가 발생해서 원인을 찾기 더욱 어렵다.
찾아보다가 또다른 원인으로는 파일명과 폴더명이 동일한 경우 가끔 발생할 수 있다고 한다.
728x90
'Development > Infra' 카테고리의 다른 글
| [K8S] Pod 내부에서 Sidecar Container 사용하기 (3) | 2022.11.29 |
|---|---|
| [Infra] Load Balancing 알고리즘 (1) | 2021.05.24 |
| [Docker] Docker Hub와 Github 연동하여 컨테이너 빌드/실행하기 (0) | 2021.03.14 |