2016-09-27 81 views
5

運行容器形成Mac上泊塢窗,作曲,這是文件錯誤運行搬運工容器:留在設備沒有足夠的空間:「/數據/ DB /雜誌」

api: 
    build: . 
    volumes: 
    - .:/src 
    - /src/node_modules 
    links: 
    - mongo 
    - redis 
    ports: 
    - "3015:3015" 
    - "5858:5858" 
mongo: 
    image: mongo:3.3 
    ports: 
    - "27017:27017" 
redis: 
    image: redis 
    ports: 
    - "6379:6379" 

運行碼頭工人,組成了蒙戈容器失敗並退出。這是日誌文件:

MongoDB starting : pid=1 port=27017 dbpath=/data/db 64-bit host=7115a6cce706 
db version v3.3.14 
git version: 507a5b4d334c1b4bea8fa232fa6b882849608e97 
OpenSSL version: OpenSSL 1.0.1t 3 May 2016 
allocator: tcmalloc 
modules: none 
build environment: 
    distmod: debian81 
    distarch: x86_64 
    target_arch: x86_64 
options: {} 
** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine 
See http://dochub.mongodb.org/core/prodnotes-filesystem 
error creating journal dir /data/db/journal boost::filesystem::create_directory: No space left on device: "/data/db/journal" 
exception in initAndListen std::exception: boost::filesystem::create_directory: No space left on device: "/data/db/journal", terminating 
shutdown: going to close listening sockets... 
removing socket file: /tmp/mongodb-27017.sock 
shutdown: going to flush diaglog... 
now exiting 
shutting down with code:100 

主要抱怨它是關於沒有剩餘空間創建一個目錄,但我不能想出如何解決它。

+0

嘗試清洗第一個碼頭集裝箱和圖像 - > http://stackoverflow.com/questions/21398087/how-to-delete-dockers-images – mkorszun

+0

我已經這樣做過,但錯誤仍然存​​在 – irokhes

回答

1

Dockerfile爲蒙戈圖像顯示,/data/db路徑是使用泊塢容量:如果您運行

VOLUME /data/db /data/configdb 

docker inspect --format '{{ .Mounts }}' <your-container> 

,將告訴你數據量被映射在那裏在你的Mac上。如果是映射驅動器,其空間不足,你可以啓動容器指着裏面確實有空間的另一個位置:

docker run -d -v <local-path-with-free-space>:/data/db mongo:3.3 

或者添加到您撰寫的文件:

volumes: 
    - <local-path-with-free-space>:/data/db 
14

我固定問題清理舊卷下一個命令:

$ docker volume rm $(docker volume ls -qf dangling=true) 

參考: docker-cleanup-volumes