bash - 无法为 tensorflow 服务创建 docker 容器

标签 bash ubuntu docker tensorflow-serving docker-container

我正在尝试创建一个 tensorflow 服务 docker 容器,但在运行 docker create 命令 enter image description here 时出现以下错误
我无法确定是因为位置错误还是我的/bin/bash 文件损坏了。我能做些什么来解决这个问题?提前致谢。

最佳答案

您的容器镜像使用什么基础镜像?我检查了busybox和alpine。他们有 ash默认但不是 bash .创建图像后,您可以按如下方式运行它:docker run -it my-image-name "sh"这应该让你进入一个交互式外壳。 cd进入 /bin并使用 ls 检查哪些命令可用.

我在 Alpine 得到了这个

/ # ls /bin
ash            df             getopt         linux64        mpstat         rev            sync
base64         dmesg          grep           ln             mv             rm             tar
bbconfig       dnsdomainname  gunzip         login          netstat        rmdir          touch
busybox        dumpkmap       gzip           ls             nice           run-parts      true
cat            echo           hostname       lzop           pidof          sed            umount
chgrp          ed             ionice         makemime       ping           setpriv        uname
chmod          egrep          iostat         mkdir          ping6          setserial      usleep
chown          false          ipcalc         mknod          pipe_progress  sh             watch
conspy         fatattr        kbd_mode       mktemp         printenv       sleep          zcat
cp             fdflush        kill           more           ps             stat
date           fgrep          link           mount          pwd            stty
dd             fsync          linux32        mountpoint     reformime      su

容器是从容器镜像创建的实例。在您的情况下,您的容器 tf_container_gpu已从您指定的图像创建。您只能在创建容器时为其命名。之后,您只需要使用该名称启动它。
docker start tf_container_gpu应该做。

如果你想重新创建你的容器(比如在你重新构建你的镜像之后)首先删除早期的容器实例
docker container rm tf_container_gpu .然后再次运行容器
docker run --name=tf_container_gpu <image-name>
只是启动和停止容器docker start tf_container_gpudocker stop tf_container_gpu

关于bash - 无法为 tensorflow 服务创建 docker 容器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48758936/

相关文章:

docker - 如何使用Kubernetes/Docker在本地有效地工作?

docker - 为什么Docker COPY在单个文件和目录下的工作方式有所不同?

linux - Bash - curl 命令行执行不佳

python - 在 python 中使用 WSL bash

c++ - 基于 Linux 的集群上的 CPUTIME 和 WALLTIME C++ 代码

ruby-on-rails - 使用 Passenger 和 Apache 调试 Rails

php - 通过PHP启动远程服务

linux - 用于在 Ubuntu 16.04 上更新 GO 项目的 Bash 脚本

docker - 忽略在用于长时间运行服务的同一 Docker 镜像上运行开关命令的重启策略

bash - 了解 { }/dev/null\;将 find 与 -exec 一起使用时