您的位置:首页 > 运维架构 > Docker

Dockerfile执行命令报错"The command '/bin/sh -c apt-get install -y git' returned a non-zero code: 100"解决

2019-02-05 23:10 866 查看

Dockerfile文件中编辑如下内容:

# An example Dockerfile for installing Git on Ubuntu
From ubuntu
MAINTAINER "urmsone"
RUN apt-get install -y git
ENTRYPOINT ["git"]

执行

docker build -t test .
命令后报错,
The command '/bin/sh -c apt-get install -y git' returned a non-zero code: 100

解决:

在install之前先update,即

apt-get update && apt-get install -y xxx

修正后的Dockerfile文件如下:

# An example Dockerfile for installing Git on Ubuntu
From ubuntu
MAINTAINER "urmsone"
RUN apt-get update --fix-missing && apt-get install -y git
ENTRYPOINT ["git"]
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐