![如何修复错误:服务无法构建:OCI 运行时创建失败](https://linux22.com/image/1068968/%E5%A6%82%E4%BD%95%E4%BF%AE%E5%A4%8D%E9%94%99%E8%AF%AF%EF%BC%9A%E6%9C%8D%E5%8A%A1%E6%97%A0%E6%B3%95%E6%9E%84%E5%BB%BA%EF%BC%9AOCI%20%E8%BF%90%E8%A1%8C%E6%97%B6%E5%88%9B%E5%BB%BA%E5%A4%B1%E8%B4%A5.png)
我正在尝试实现这个计算机视觉 github 的存储库并使用 Ubuntu 18.04.1,但我卡住了。我安装了 nvidia-docker 来使用 Nvidia GPU 设置 docker。因此,要在 GPU 中运行演示。在解决一些依赖关系问题后,我最终遇到了这个错误。
$ docker-compose up
Building vehicle_counting
Step 1/3 : FROM tensorflow/tensorflow:1.4.0-gpu-py3
---> c349ca9427dc
Step 2/3 : RUN apt update -y && apt install -y python3-dev libsm6 libxext6 libxrender-dev python3-tk
---> Running in 63e84d498e36
ERROR: Service 'vehicle_counting' failed to build: OCI runtime create failed: container_linux.go:349: starting container process caused "exec: \"/bin/sh\": stat /bin/sh: no such file or directory": unknown
首先,我apt update -y && apt install -y python3-dev libsm6 libxext6 libxrender-dev python3-tk
按照建议运行Step 2/3
,然后docker-compose up
再次运行,但没有成功。
其次,我尝试创建一个图片来自高山正如本期所建议的评论。然而,还无法修复它。
我的$ sudo docker info
输出:
Client:
Debug Mode: false
Server:
Containers: 6
Running: 0
Paused: 0
Stopped: 6
Images: 1
Server Version: 19.03.12
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 7ad184331fa3e55e52b890ea95e65ba581ae3429
runc version: dc9208a3303feef5b3839f4323d9beb36df0a9dd
init version: fec3683
Security Options:
apparmor
seccomp
Profile: default
Kernel Version: 5.4.0-42-generic
Operating System: Ubuntu 18.04.4 LTS
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 7.465GiB
Name: sutd-ThinkPad-T430
ID: EPKL:3BDO:PPX2:6QN4:DM3R:KFHI:MD3K:NWEB:KXEH:BFP4:4YQZ:5RWW
Docker Root Dir: /var/lib/docker
Debug Mode: false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
WARNING: API is accessible on http://0.0.0.0:2736 without encryption.
Access to the remote API is equivalent to root access on the host. Refer
to the 'Docker daemon attack surface' section in the documentation for
more information: https://docs.docker.com/engine/security/security/#docker-daemon-attack-surface
WARNING: No swap limit support
这是docker-compose.yml
:
version: '2.3'
services:
vehicle_counting:
image: vehicle_counting
container_name: vehicle_counting
working_dir: /vehicle_counting
build:
context: .
environment:
- DISPLAY=unix$DISPLAY
command: python3 -u vehicle_detection_main.py
volumes:
- ./:/vehicle_counting
- /tmp/.X11-unix:/tmp/.X11-unix
runtime: nvidia
DockerFile
:
FROM tensorflow/tensorflow:1.4.0-gpu-py3
RUN apt update -y && apt install -y \
python3-dev \
libsm6 \
libxext6 \
libxrender-dev \
python3-tk
RUN pip3 install \
numpy \
opencv-python \
matplotlib
如果我想发布任何日志,请告诉我。提前致谢。如果能提出任何我做错的事情的建议,我将不胜感激。