我安装了最新的 Docker for Mac,但我遇到了一个问题,似乎 docker-compose up
卡在其中一个容器的下载状态:
± |master ✗| → docker-compose up --build
Pulling container (repo.io/company/container:prod)...
prod: Pulling from company/container
somehash: Already exists
somehash: Already exists
somehash: Already exists
somehash: Already exists
somehash: Pulling fs layer
somehash: Already exists
somehash: Already exists
somehash: Downloading [=================================================> ] 234.6 MB/239.3 MB
somehash: Download complete
somehash: Download complete
^^ 这就是它在我的命令行上的样子。停止和启动没有帮助,它立即输出相同的输出。
我尝试rm
容器,但我猜它还不存在,它返回输出No stopped containers
。 --force-recreate
也卡在同一个地方。也许我没有在谷歌上搜索正确的术语,但我没有找到任何有用的尝试 - 任何指针?
最佳答案
我只需要重启 Docker。
Linux 用户可以使用 sudo service docker restart
。
Docker for Mac 在 macOS 工具栏中的 Docker 小部件中有一个方便的按钮:
如果您碰巧在使用 Docker Toolkit,请尝试 docker-machine restart
。
关于Docker Compose 卡住下载或拉取 fs 层,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38087027/