无法使用RUN构建Docker镜像来安装git

时间:2018-01-11 20:58:28

标签: docker dockerfile

我正在尝试使用Debian base和git安装构建docker镜像,但我一直收到错误。这是Dockerfile:

FROM debian:stable

RUN apt-get update
RUN apt-get install -y git

这是错误:

$ docker build . --no-cache
Sending build context to Docker daemon 2.048 kB
Step 1 : FROM debian:stable
 ---> e03ce33c6fd7
Step 2 : RUN apt-get update
 ---> Running in 07b67a2a5c5b
Err:1 http://security.debian.org stable/updates InRelease
  Temporary failure resolving 'security.debian.org'
Err:2 http://deb.debian.org/debian stable InRelease
  Temporary failure resolving 'deb.debian.org'
Err:3 http://deb.debian.org/debian stable-updates InRelease
  Temporary failure resolving 'deb.debian.org'
Reading package lists...
W: Failed to fetch http://deb.debian.org/debian/dists/stable/InRelease  Temporary failure resolving 'deb.debian.org'
W: Failed to fetch http://deb.debian.org/debian/dists/stable-updates/InRelease  Temporary failure resolving 'deb.debian.org'
W: Failed to fetch http://security.debian.org/dists/stable/updates/InRelease  Temporary failure resolving 'security.debian.org'
W: Some index files failed to download. They have been ignored, or old ones used instead.
 ---> be533607c8ed
Removing intermediate container 07b67a2a5c5b
Step 3 : RUN apt-get install -y git
 ---> Running in eb86bfd94470
Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package git
The command '/bin/sh -c apt-get install -y git' returned a non-zero code: 100

我可以得到一些帮助吗?

0 个答案:

没有答案