2017-03-22 3 views
0

docker가 재부팅 할 때 컨테이너를 다시 시작할 수있는 도커 작성 파일을 구성하는 데 문제가 있습니다 (내 OS는 Ubuntu 16.04 임). 문제는 내가 restart: always을 전달할 때가 아니라 내 컨테이너가 볼륨 기반 파일 (예 : sgin-cert in nginx)을 필요로 할 때입니다. 내 코드 (docker-compose.yml에서) :항상 다시 시작되는 Docker 볼륨이 활성화되었습니다.

php: 
    entrypoint: ["wait-for-it", "dockerhost:3306", "-t", "0", "--", "/install.sh"] 
    environment: 
     - ENVIRONMENT=prod 
    volumes: 
     - ${FILE}:/file 
     - /code 
    env_file: 
     - prod.env 
    restart: always 

그리고 내가 직접 시작할 때 모든 것이 괜찮습니다. 재부팅 후에 작동하는지 확인하고 있습니다. 그러나 아니, 그것은 작동하지 않습니다, docker-compose ps 준다 : 나는 도니는 다르게 그 확신

"Mounts": [ 
      { 
       "Type": "bind", 
       "Source": "/home/mblocinski/hehe.txt", 
       "Destination": "/file", 
       "Mode": "rw", 
       "RW": true, 
       "Propagation": "" 
      } 
] 

:

"Error": "oci runtime error: container_linux.go:247: starting container process caused \"process_linux.go:359: container init caused \\\"rootfs_linux.go:54: mounting \\\\\\\"/home/mblocinski/hehe.txt\\\\\\\" to rootfs \\\\\\\"/var/lib/docker/aufs/mnt/d746adf311098a9e2ffc27d9447a3e448ecfb9081ff4757704c24ec51ef9053e\\\\\\\" at \\\\\\\"/var/lib/docker/aufs/mnt/d746adf311098a9e2ffc27d9447a3e448ecfb9081ff4757704c24ec51ef9053e/file\\\\\\\" caused \\\\\\\"not a directory\\\\\\\"\\\"\"\n: 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" 

그리고 마운트 :

Name     Command    State  Ports 
-----------------------------------------------------------------------   
panel_php_1  wait-for-it dockerhost:330 ... Exit 127 

docker inspect panel_php_1을 실행하여이 오류 메아리. txt 파일은 디렉토리가 아니라 파일입니다. 어쩌면 디렉토리에있는 컨테이너에 볼륨을 설치하는 것이 효과적이라면 도움이 될 것입니다. 제발 도와주세요, 이미 인터넷 전체를 검색하고 아무것도 정말로 작동하지 않습니다. 감사합니다.

답변

1

/home이 encfs로 암호화되어 있는지 확인하십시오. 기본적으로 Ubuntu는 설치 중에이 기능을 구성합니다.

이 명령을 실행하십시오 : mount|grep home 출력이 type encfs 또는 이와 비슷한지 확인하십시오.

+0

예 파일 소스를/etc/file로 변경하면 실제로 'type ecryptfs'가됩니다. – PianistaMichal