繁体   English   中英

Docker-compose 错误“无法关闭容器”

[英]Docker-compose error "failed to shutdown container"

我正在 windows 容器中尝试 docker-compose,出现以下错误 - 无法关闭容器:容器。 查看 id 3878f34c9213 的容器状态,它显示已退出...如何查找此容器退出的原因或如何解决此错误? Windows 10机 Docker 19.03.8版

> docker-compose up                                           Building web
Step 1/5 : FROM python:3.7-alpine
3.7-alpine: Pulling from library/python
df20fa9351a1: Pull complete                                                                          36b3adc4ff6f: Pull complete                                                                                             d4f879c74e1d: Pull complete                                                                                             6064e23ad526: Pull complete                                                                                             ff64a3b3d6f3: Pull complete                                                                                             Digest: sha256:3bb2acc9bd988159abe35442a208895de22b76ecdbf565c636edbf01551d9905
Status: Downloaded newer image for python:3.7-alpine
 ---> 6ca3e0b1ab69
Step 2/5 : ADD . /code
 ---> 977f90bbc7d0
Step 3/5 : WORKDIR /code
 ---> Running in 300fbdd6e6aa
Removing intermediate container 300fbdd6e6aa
 ---> 5e50e300e614
Step 4/5 : RUN pip install -r requirements.txt
 ---> Running in 3878f34c9213
Collecting flask
  Downloading Flask-1.1.2-py2.py3-none-any.whl (94 kB)
Collecting redis
  Downloading redis-3.5.3-py2.py3-none-any.whl (72 kB)
Collecting Jinja2>=2.10.1
  Downloading Jinja2-2.11.2-py2.py3-none-any.whl (125 kB)
Collecting Werkzeug>=0.15
  Downloading Werkzeug-1.0.1-py2.py3-none-any.whl (298 kB)
Collecting click>=5.1
  Downloading click-7.1.2-py2.py3-none-any.whl (82 kB)
Collecting itsdangerous>=0.24
  Downloading itsdangerous-1.1.0-py2.py3-none-any.whl (16 kB)
Collecting MarkupSafe>=0.23
  Downloading MarkupSafe-1.1.1.tar.gz (19 kB)
Building wheels for collected packages: MarkupSafe
  Building wheel for MarkupSafe (setup.py): started
  Building wheel for MarkupSafe (setup.py): finished with status 'done'
  Created wheel for MarkupSafe: filename=MarkupSafe-1.1.1-py3-none-any.whl size=12629 sha256=b08bae4a80da844e9226dbae27c8fa16b6273a37a4d2cb97d34829132689bdb1
  Stored in directory: /root/.cache/pip/wheels/b9/d9/ae/63bf9056b0a22b13ade9f6b9e08187c1bb71c47ef21a8c9924
Successfully built MarkupSafe
Installing collected packages: MarkupSafe, Jinja2, Werkzeug, click, itsdangerous, flask, redis
Successfully installed Jinja2-2.11.2 MarkupSafe-1.1.1 Werkzeug-1.0.1 click-7.1.2 flask-1.1.2 itsdangerous-1.1.0 redis-3.5.3
ERROR: Service 'web' failed to build: The command '/bin/sh -c pip install -r requirements.txt' returned a non-zero code: 4294967295: failed to shutdown container: container 3878f34c9213071785a2bd0641a8490af52b5fb2607a6209c5014a33aef4ff29 encountered an error during hcsshim::System::waitBackground: failure in a Windows system call: The virtual machine or container with the specified identifier is not running. (0xc0370110): subsequent terminate failed container 3878f34c9213071785a2bd0641a8490af52b5fb2607a6209c5014a33aef4ff29 encountered an error during hcsshim::System::waitBackground: failure in a Windows system call: The virtual machine or container with the specified identifier is not running. (0xc0370110)

docker ps -a
--------------
CONTAINER ID        IMAGE               COMMAND                   CREATED             STATUS                               PORTS               NAMES
3878f34c9213        5e50e300e614        "/bin/sh -c 'pip ins…"    32 minutes ago      Exited (4294967295) 32 minutes ago                       vibrant_rosalind
636cab556759        2f1fe904a562        "/bin/sh -c 'pip ins…"    39 minutes ago      Exited (4294967295) 39 minutes ago                       silly_mclean
658dd0803e98        2f1fe904a562        "/bin/sh -c 'pip ins…"    2 hours ago         Exited (4294967295) 2 hours ago                          bold_jackson
22bd52938931        ubuntu              "/bin/bash"               13 hours ago        Exited (4294967295) 13 hours ago                         hardcore_hertz
b56a2a9a8684        ubuntu              "/bin/bash"               43 hours ago        Exited (4294967295) 13 hours ago                         vigilant_napier
f7b70aba6f84        hello-world         "cmd /C 'type C:\\hel…"   44 hours ago        Exited (0) 44 hours ago                                  brave_goldberg

当您切换到Linux 容器时,它会有所帮助。

如果您使用 Linux 容器,那么当您在 Docker 上按 RMB 时,您将看到“切换到 Windows 容器...”。

在此处输入图像描述

我在使用 docker 时遇到此错误,我卸载了 docker 并将其安装在另一个版本中,并且成功了!

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM