Dockerfile 无法构建 [英] Dockerfile fails to build

查看:24
本文介绍了Dockerfile 无法构建的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

直到几天前 Dockerfile 工作正常,当我今天再次尝试构建它时,它在终端中出现以下错误.我尝试了多个 docker 基本图像,但仍然给出相同的错误.谁能帮我这个?我不认为我错过了什么.如果我错过了,它应该早先给我错误,但为什么现在呢?

Till few days back the Dockerfile was working fine and when i tried to build it again today it is giving following error in the terminal. I tried with multiple docker base images but still giving the same error. Can any one help me with this? I dont think i missed out anything. If i had missed it should have given me the error earlier itself but why now?

Err:1 http://security.ubuntu.com/ubuntu xenial-security InRelease
  Temporary failure resolving 'security.ubuntu.com'
Err:2 http://archive.ubuntu.com/ubuntu xenial InRelease
  Temporary failure resolving 'archive.ubuntu.com'
Err:3 http://archive.ubuntu.com/ubuntu xenial-updates InRelease
  Temporary failure resolving 'archive.ubuntu.com'
Err:4 http://archive.ubuntu.com/ubuntu xenial-backports InRelease
  Temporary failure resolving 'archive.ubuntu.com'
Reading package lists...
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial/InRelease  Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial-updates/InRelease  Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial-backports/InRelease  Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/InRelease  Temporary failure resolving 'security.ubuntu.com'
W: Some index files failed to download. They have been ignored, or old ones used instead.
Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package software-properties-common    

<小时>

我的 docker 版本是Docker 版本 17.03.2-ce,构建 f5ec1e2

这是我的 Dockerfile

FROM ubuntu:16.04

ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update -y && 
    apt-get install -y software-properties-common && 
    apt-add-repository ppa:webupd8team/java && 
    apt-get update -y && 
    apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886 && 
    echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections && 
    apt-get install -y oracle-java8-installer && 
    apt-get install -y oracle-java8-unlimited-jce-policy && 
    apt-get clean && 
    rm -rf /var/lib/apt/lists/* && 
    rm -rf /var/cache/oracle-jdk8-installer

ENV JAVA_HOME /usr/lib/jvm/java-8-oracle

推荐答案

我刚刚更改了我的 VM 播放器网络设置.将 Network Connection桥接模式更改为 NAT.现在它工作了

I just changed my VM players network setting. Changed Network Connection from bridged mode to NAT. Now its working

这篇关于Dockerfile 无法构建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆