docker 불안정 short running containers with -rm failed to destroy

9027 단어 contain
다음 명령을 정상적으로 실행합니다
sudo docker run --rm busybox echo helloworld
 
/var/log/upstart/docker.로그 로그는 다음과 같습니다.
2014/08/07 00:12:02 POST /v1.13/containers/create
[339dd1d9] +job create()
[339dd1d9] -job create() = OK (0)
2014/08/07 00:12:02 POST /v1.13/containers/5abf93d6f3f8fc6166f12fb0682d3f4d8a056cb7a07b9ef52f109525137192c0/attach?stderr=1&stdout=1&stream=1
[339dd1d9] +job container_inspect(5abf93d6f3f8fc6166f12fb0682d3f4d8a056cb7a07b9ef52f109525137192c0)
[339dd1d9] -job container_inspect(5abf93d6f3f8fc6166f12fb0682d3f4d8a056cb7a07b9ef52f109525137192c0) = OK (0)
[339dd1d9] +job attach(5abf93d6f3f8fc6166f12fb0682d3f4d8a056cb7a07b9ef52f109525137192c0)
2014/08/07 00:12:02 POST /v1.13/containers/5abf93d6f3f8fc6166f12fb0682d3f4d8a056cb7a07b9ef52f109525137192c0/start
[339dd1d9] +job start(5abf93d6f3f8fc6166f12fb0682d3f4d8a056cb7a07b9ef52f109525137192c0)
[339dd1d9] +job allocate_interface(5abf93d6f3f8fc6166f12fb0682d3f4d8a056cb7a07b9ef52f109525137192c0)
[339dd1d9] -job allocate_interface(5abf93d6f3f8fc6166f12fb0682d3f4d8a056cb7a07b9ef52f109525137192c0) = OK (0)
[339dd1d9] -job start(5abf93d6f3f8fc6166f12fb0682d3f4d8a056cb7a07b9ef52f109525137192c0) = OK (0)
[339dd1d9] +job release_interface(5abf93d6f3f8fc6166f12fb0682d3f4d8a056cb7a07b9ef52f109525137192c0)
[339dd1d9] -job release_interface(5abf93d6f3f8fc6166f12fb0682d3f4d8a056cb7a07b9ef52f109525137192c0) = OK (0)
[339dd1d9] -job attach(5abf93d6f3f8fc6166f12fb0682d3f4d8a056cb7a07b9ef52f109525137192c0) = OK (0)
2014/08/07 00:12:03 POST /v1.13/containers/5abf93d6f3f8fc6166f12fb0682d3f4d8a056cb7a07b9ef52f109525137192c0/wait
[339dd1d9] +job wait(5abf93d6f3f8fc6166f12fb0682d3f4d8a056cb7a07b9ef52f109525137192c0)
[339dd1d9] -job wait(5abf93d6f3f8fc6166f12fb0682d3f4d8a056cb7a07b9ef52f109525137192c0) = OK (0)
2014/08/07 00:12:03 GET /v1.13/containers/5abf93d6f3f8fc6166f12fb0682d3f4d8a056cb7a07b9ef52f109525137192c0/json
[339dd1d9] +job container_inspect(5abf93d6f3f8fc6166f12fb0682d3f4d8a056cb7a07b9ef52f109525137192c0)
[339dd1d9] -job container_inspect(5abf93d6f3f8fc6166f12fb0682d3f4d8a056cb7a07b9ef52f109525137192c0) = OK (0)
2014/08/07 00:12:03 DELETE /v1.13/containers/5abf93d6f3f8fc6166f12fb0682d3f4d8a056cb7a07b9ef52f109525137192c0?v=1
[339dd1d9] +job container_delete(5abf93d6f3f8fc6166f12fb0682d3f4d8a056cb7a07b9ef52f109525137192c0)
[339dd1d9] -job container_delete(5abf93d6f3f8fc6166f12fb0682d3f4d8a056cb7a07b9ef52f109525137192c0) = OK (0)

 
이것을crontab에 기록합니다. 분당 한 번씩 실행하면 다음과 같은 오류가 발생할 확률이 있습니다. (docker run을 더 자주 실행하면 오류가 발생할 확률이 더 높습니다. 현재 1분에 한 번씩 오류가 발생할 확률은 대략 2일에 한 번error)
Error response from daemon: Cannot destroy container b12b979ec303276ad8c7fedcdf687c7c3760c822297fb3b7f39f52954b90057e: Driver aufs failed to remove root filesystem b12b979ec303276ad8c7fedcdf687c7c3760c822297fb3b7f39f52954b90057e: rename /var/lib/docker/aufs/mnt/b12b979ec303276ad8c7fedcdf687c7c3760c822297fb3b7f39f52954b90057e /var/lib/docker/aufs/mnt/b12b979ec303276ad8c7fedcdf687c7c3760c822297fb3b7f39f52954b90057e-removing: device or resource busy
Error response from daemon: Cannot destroy container b103443f2f2d74862e4aa37132043b9ca4aa1ade7bbac37a514c051f859d0473: Unable to remove filesystem for b103443f2f2d74862e4aa37132043b9ca4aa1ade7bbac37a514c051f859d0473: remove /var/lib/docker/containers/b103443f2f2d74862e4aa37132043b9ca4aa1ade7bbac37a514c051f859d0473: directory not empty

 
원인: 기본적으로 docker가 불안정해서 그런지 container를 빠르게 실행할 때 위와 같은 오류가 발생할 확률이 있습니다
이와 관련된 issue는 다음과 같다.
https://github.com/docker/docker/issues/4095
https://github.com/docker/docker/issues/3968
https://github.com/docker/docker/issues/3823
 
내 기계의 정보는 다음과 같다.
root@localhost:~# docker info
Containers: 4
Images: 12
Storage Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Dirs: 20
Execution Driver: native-0.2
Kernel Version: 3.8.0-44-generic
WARNING: No swap limit support
root@localhost:~# docker version
Client version: 1.1.2
Client API version: 1.13
Go version (client): go1.2.1
Git commit (client): d84a070
Server version: 1.1.2
Server API version: 1.13
Go version (server): go1.2.1
Git commit (server): d84a070

root@hadoop-yarn-three:~# uname -a
Linux localhost 3.8.0-44-generic #66~precise1-Ubuntu SMP Tue Jul 15 04:01:04 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
 

 
만약에 docker가 이 issue를 해결한 것을 발견하신 분은 docker version과 기계 정보를 보내주세요. 감사합니다.
@Tom형, rhel6.5 코어 버전 2.6.32, docker version 1.1.2, 문제 없음
@IT인, ubuntu 14.04 centos 7.07.1 이 질문 없습니다.
나는 아직 검증한 적이 없다.

좋은 웹페이지 즐겨찾기