Ubuntu安装ping工具后打包的镜像部署报错
来源:2-5 Vagrant&VirtualBox for Windows
慕码人9274422
2020-06-23
下载了ubuntu的镜像后,在镜像中使用apt-get update和apt-get install inetutils-ping命令安装了ping工具,实现了在ubuntu容器中使用ping命令检测网络情况。
随后将安装ping工具的容器打包为一个镜像,部署该镜像时报错如下
OCI runtime create failed: container_linux.go:348: starting container process caused “no such file or directory”: unknown.
写回答
5回答
-
麦兜搞IT
2020-06-27
比如
$ docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 246d5a19d6ec my-ubuntu "sh" 22 hours ago Exited (0) 19 seconds ago vibrant_lovelace $ docker commit -m 'create from container' 246d5a19d6ec my-ubuntu-2 sha256:ed084fd10d9235c4ca946bd137ecd72b1bf7f2608d592de6577ad1db46bfc8b7 $ docker image ls | grep my-ubuntu my-ubuntu-2 latest ed084fd10d92 16 seconds ago 97.2MB my-ubuntu latest 2cfb5d494897 22 hours ago 97.2MB $ docker run -it my-ubuntu-2 sh # ping www.baidu.com PING www.wshifen.com (104.193.88.123): 56 data bytes 64 bytes from 104.193.88.123: icmp_seq=0 ttl=37 time=181.706 ms 64 bytes from 104.193.88.123: icmp_seq=1 ttl=37 time=172.678 ms ^C--- www.wshifen.com ping statistics --- 2 packets transmitted, 2 packets received, 0% packet loss round-trip min/avg/max/stddev = 172.678/177.192/181.706/4.514 ms #
10 -
慕码人9274422
提问者
2020-06-26
你这个是通过dockerfile里面配置安装ping工具构建容器把?如果这个具备ping工具的容器生成镜像,生成的镜像能否正常部署呢?
012020-06-27 -
麦兜搞IT
2020-06-26
您好,我没有用过portainer,下面是我的Dockerfile做的实验
$ more Dockerfile FROM ubuntu:latest RUN apt-get -y update && apt-get install -y inetutils-ping $ docker docker build -t my-ubuntu . Sending build context to Docker daemon 2.048kB Step 1/2 : FROM ubuntu:latest ---> 74435f89ab78 Step 2/2 : RUN apt-get -y update && apt-get install -y inetutils-ping ---> Using cache ---> 2cfb5d494897 Successfully built 2cfb5d494897 Successfully tagged my-ubuntu:latest $ docker run -it my-ubuntu sh # ping ping: missing host operand Try 'ping --help' or 'ping --usage' for more information. # ping www.baidu.com PING www.wshifen.com (104.193.88.77): 56 data bytes 64 bytes from 104.193.88.77: icmp_seq=0 ttl=37 time=166.561 ms 64 bytes from 104.193.88.77: icmp_seq=1 ttl=37 time=173.235 ms ^C--- www.wshifen.com ping statistics --- 2 packets transmitted, 2 packets received, 0% packet loss round-trip min/avg/max/stddev = 166.561/169.898/173.235/3.337 ms #
00 -
慕码人9274422
提问者
2020-06-25
我是用的portainer打包和运行镜像的。没有dockerfile,但是我试了下直接用docker run镜像是会有这个报错的。
012020-06-26 -
麦兜搞IT
2020-06-25
您是怎么打包的,能把dockefile发我一下么?另外您是怎么运行这个容器的,命令发一下
00
相似问题