我在linux系统上运行docker。
linux uname -a显示:Linux TENCENT64.site 3.10.94-1-tlinux2-0036.tl2
泊坞窗版本为:1.8.3
当我尝试构建映像时,docker会返回错误消息:失败的沙箱添加:更新网关时无法设置网关:无效参数
我的Dockerfile是:
# centos 7
FROM centos:7
MAINTAINER a b
# make work dirs
RUN mkdir /workspace
# add passport files
COPY ./output.tar.gz /workspace/
# add start script
COPY ./resources/start.sh /workspace/
EXPOSE 22
EXPOSE 8082
CMD ["/usr/sbin/sshd", "-D"]
完整的错误消息是:
Sending build context to Docker daemon 3.284 MB
Step 0 : FROM centos:7
---> eeb3a076a0be
Step 1 : MAINTAINER AlphaCloud wangziyi <wangziyi@didichuxing.com>
---> Using cache
---> dc3d3f638d8d
Step 2 : RUN mkdir /workspace
---> Running in 53a34c6d1731
failed sandbox add: failed to set gateway while updating gateway: invalid argument
我的码头工艺是:
/usr/bin/docker daemon --ip-forward=false --iptables=false --insecure-registry=10.10.10.39
帮帮我
答案 0 :(得分:0)
Yes, we read some source code of docker, this error is because docker can't find a gateway to access network. our kernel is cut some network models, so we have to run docker in host network mode.
add --bridge=none
to your docker daemon start command.
the full start command is docker daemon --bridge=none --ip-forward=false --iptables=false
but, there is some effect on docker build
you can't build image using like yum or else network needed way.
detail see: https://github.com/docker/docker/issues/22064