首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >docker apt-get安装获取文件失败

docker apt-get安装获取文件失败
EN

Stack Overflow用户
提问于 2021-08-12 22:39:32
回答 2查看 1.1K关注 0票数 0

我在DockerFile中有以下命令

代码语言:javascript
运行
复制
# Use the official image as a parent image.
FROM ubuntu:18.04
#FROM node:10.18.0


# Install Node.js
RUN apt-get update && apt-get install -y \
  wget \
  build-essential \
  software-properties-common


# install node version 10.18, need to use this specific
# version since it is the version that works with mapnik

RUN wget https://nodejs.org/dist/v10.18.0/node-v10.18.0-linux-x64.tar.xz

RUN tar -xJf node-v10.18.0-linux-x64.tar.xz -C /usr/local --strip-components=1 --no-same-owner \
  && rm node-v10.18.0-linux-x64.tar.xz \
  && ln -s /usr/local/bin/node /usr/local/bin/nodejs \
  && node --version \
  && npm --version

# install gdal
RUN add-apt-repository ppa:ubuntugis/ppa

RUN apt-get update && apt-get install -y --no-install-recommends \
  gdal-bin \
  cmake \ 
  build-essential \
  git \
  ca-certificates \
  libgdal-dev

如果出现以下错误,它将失败:

代码语言:javascript
运行
复制
et:151 http://archive.ubuntu.com/ubuntu bionic/main amd64 unixodbc-dev amd64 2.3.4-1.1ubuntu3 [217 kB]
Err:152 http://ppa.launchpad.net/ubuntugis/ppa/ubuntu bionic/main amd64 libgeos-c1v5 amd64 3.7.1-1~bionic0
  Could not connect to ppa.launchpad.net:80 (91.189.95.85), connection timed out [IP: 91.189.95.85 80]
Err:153 http://ppa.launchpad.net/ubuntugis/ppa/ubuntu bionic/main amd64 proj-data all 5.2.0-1~bionic0
  Unable to connect to ppa.launchpad.net:http: [IP: 91.189.95.85 80]
Err:154 http://ppa.launchpad.net/ubuntugis/ppa/ubuntu bionic/main amd64 libproj13 amd64 5.2.0-1~bionic0
  Unable to connect to ppa.launchpad.net:http: [IP: 91.189.95.85 80]
Err:155 http://ppa.launchpad.net/ubuntugis/ppa/ubuntu bionic/main amd64 libgeotiff2 amd64 1.4.2-2build1+bionic0
  Unable to connect to ppa.launchpad.net:http: [IP: 91.189.95.85 80]
Err:156 http://ppa.launchpad.net/ubuntugis/ppa/ubuntu bionic/main amd64 libogdi4.1 amd64 4.1.0+ds-1~bionic0
  Unable to connect to ppa.launchpad.net:http: [IP: 91.189.95.85 80]
Err:157 http://ppa.launchpad.net/ubuntugis/ppa/ubuntu bionic/main amd64 libspatialite7 amd64 4.3.0a-5build1+bionic1
  Unable to connect to ppa.launchpad.net:http: [IP: 91.189.95.85 80]
Err:158 http://ppa.launchpad.net/ubuntugis/ppa/ubuntu bionic/main amd64 libgdal20 amd64 2.4.2+dfsg-1~bionic0
  Unable to connect to ppa.launchpad.net:http: [IP: 91.189.95.85 80]
Err:159 http://ppa.launchpad.net/ubuntugis/ppa/ubuntu bionic/main amd64 gdal-bin amd64 2.4.2+dfsg-1~bionic0
  Unable to connect to ppa.launchpad.net:http: [IP: 91.189.95.85 80]
Err:160 http://ppa.launchpad.net/ubuntugis/ppa/ubuntu bionic/main amd64 libgeos-dev amd64 3.7.1-1~bionic0
  Unable to connect to ppa.launchpad.net:http: [IP: 91.189.95.85 80]
Err:161 http://ppa.launchpad.net/ubuntugis/ppa/ubuntu bionic/main amd64 libgeotiff-dev amd64 1.4.2-2build1+bionic0
  Unable to connect to ppa.launchpad.net:http: [IP: 91.189.95.85 80]
Err:162 http://ppa.launchpad.net/ubuntugis/ppa/ubuntu bionic/main amd64 libogdi-dev amd64 4.1.0+ds-1~bionic0
  Unable to connect to ppa.launchpad.net:http: [IP: 91.189.95.85 80]
Err:163 http://ppa.launchpad.net/ubuntugis/ppa/ubuntu bionic/main amd64 libproj-dev amd64 5.2.0-1~bionic0
  Unable to connect to ppa.launchpad.net:http: [IP: 91.189.95.85 80]
Err:164 http://ppa.launchpad.net/ubuntugis/ppa/ubuntu bionic/main amd64 libspatialite-dev amd64 4.3.0a-5build1+bionic1
  Unable to connect to ppa.launchpad.net:http: [IP: 91.189.95.85 80]
Err:165 http://ppa.launchpad.net/ubuntugis/ppa/ubuntu bionic/main amd64 libgdal-dev amd64 2.4.2+dfsg-1~bionic0
  Unable to connect to ppa.launchpad.net:http: [IP: 91.189.95.85 80]
Fetched 61.7 MB in 33s (1896 kB/s)
E: Failed to fetch http://ppa.launchpad.net/ubuntugis/ppa/ubuntu/pool/main/g/geos/libgeos-c1v5_3.7.1-1~bionic0_amd64.deb  Could not connect to ppa.launchpad.net:80 (91.189.95.85), connection timed out [IP: 91.189.95.85 80]
E: Failed to fetch http://ppa.launchpad.net/ubuntugis/ppa/ubuntu/pool/main/p/proj/proj-data_5.2.0-1~bionic0_all.deb  Unable to connect to ppa.launchpad.net:http: [IP: 91.189.95.85 80]
E: Failed to fetch http://ppa.launchpad.net/ubuntugis/ppa/ubuntu/pool/main/p/proj/libproj13_5.2.0-1~bionic0_amd64.deb  Unable to connect to ppa.launchpad.net:http: [IP: 91.189.95.85 80]
E: Failed to fetch http://ppa.launchpad.net/ubuntugis/ppa/ubuntu/pool/main/libg/libgeotiff-dfsg/libgeotiff2_1.4.2-2build1+bionic0_amd64.deb  Unable to connect to ppa.launchpad.net:http: [IP: 91.189.95.85 80]
E: Failed to fetch http://ppa.launchpad.net/ubuntugis/ppa/ubuntu/pool/main/o/ogdi-dfsg/libogdi4.1_4.1.0+ds-1~bionic0_amd64.deb  Unable to connect to ppa.launchpad.net:http: [IP: 91.189.95.85 80]
E: Failed to fetch http://ppa.launchpad.net/ubuntugis/ppa/ubuntu/pool/main/s/spatialite/libspatialite7_4.3.0a-5build1+bionic1_amd64.deb  Unable to connect to ppa.launchpad.net:http: [IP: 91.189.95.85 80]
E: Failed to fetch http://ppa.launchpad.net/ubuntugis/ppa/ubuntu/pool/main/g/gdal/libgdal20_2.4.2+dfsg-1~bionic0_amd64.deb  Unable to connect to ppa.launchpad.net:http: [IP: 91.189.95.85 80]
E: Failed to fetch http://ppa.launchpad.net/ubuntugis/ppa/ubuntu/pool/main/g/gdal/gdal-bin_2.4.2+dfsg-1~bionic0_amd64.deb  Unable to connect to ppa.launchpad.net:http: [IP: 91.189.95.85 80]
E: Failed to fetch http://ppa.launchpad.net/ubuntugis/ppa/ubuntu/pool/main/g/geos/libgeos-dev_3.7.1-1~bionic0_amd64.deb  Unable to connect to ppa.launchpad.net:http: [IP: 91.189.95.85 80]
E: Failed to fetch http://ppa.launchpad.net/ubuntugis/ppa/ubuntu/pool/main/libg/libgeotiff-dfsg/libgeotiff-dev_1.4.2-2build1+bionic0_amd64.deb  Unable to connect to ppa.launchpad.net:http: [IP: 91.189.95.85 80]
E: Failed to fetch http://ppa.launchpad.net/ubuntugis/ppa/ubuntu/pool/main/o/ogdi-dfsg/libogdi-dev_4.1.0+ds-1~bionic0_amd64.deb  Unable to connect to ppa.launchpad.net:http: [IP: 91.189.95.85 80]
E: Failed to fetch http://ppa.launchpad.net/ubuntugis/ppa/ubuntu/pool/main/p/proj/libproj-dev_5.2.0-1~bionic0_amd64.deb  Unable to connect to ppa.launchpad.net:http: [IP: 91.189.95.85 80]
E: Failed to fetch http://ppa.launchpad.net/ubuntugis/ppa/ubuntu/pool/main/s/spatialite/libspatialite-dev_4.3.0a-5build1+bionic1_amd64.deb  Unable to connect to ppa.launchpad.net:http: [IP: 91.189.95.85 80]
E: Failed to fetch http://ppa.launchpad.net/ubuntugis/ppa/ubuntu/pool/main/g/gdal/libgdal-dev_2.4.2+dfsg-1~bionic0_amd64.deb  Unable to connect to ppa.launchpad.net:http: [IP: 91.189.95.85 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

我可以直接访问这些文件,例如在浏览器中粘贴这个链接,amd64.deb您将下载该文件。

这过去很管用,但现在不行了。有什么想法吗?

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2021-08-16 19:39:00

对我来说,这个特别的问题与互联网接入无关,因为apt-get更新很好,gis ppa不知怎么坏了,坦率地说,您不再需要它与18.04的LTS图像,也许默认的18.04图像已经更新。

删除

代码语言:javascript
运行
复制
RUN add-apt-repository ppa:ubuntugis/ppa
票数 0
EN

Stack Overflow用户

发布于 2021-08-16 05:49:48

在我的例子中,问题是没有从我的码头容器中启用ipv6,而且所讨论的ppa (ondre/php)肯定已经开始执行它了。这使我花了一个星期的时间把头撞在墙上。实际上,我重新启动了我的笔记本电脑很多次,我遇到了Ubuntu臭名昭著的、持续的、低亮度的错误--但这是另一个故事。所以,在包扎我的头,打个盹,休息一下,祈祷之后,我做了些什么来解决这个问题:

后面列出的资源

  1. 将Ubuntu升级到最新版本(我认为这是可选的--我刚把刀柄弄得满满的)
  2. 清除并重新安装Docker到最新版本(现在20)
  3. 在调制解调器上找到我的ipv6设置并确保它们正常工作。(他们是)。基本上,确保ipv6在码头主机上工作
  4. 停下码头。systemctl stop docker
  5. 在daemon.json中创建/etc/docker文件并添加以下内容:
代码语言:javascript
运行
复制
{
  "data-root": "/home/user/docker/data",
  "ipv6": true,
  "fixed-cidr-v6": "fd00::/80"
}

最后两个属性是您关注的重点。

  1. 重新启动码头systemctl start docker。此时,您应该没有码头错误。
  2. 然后,这是关键,启用从码头容器通过主机的ipv6访问:(在主机上运行)
代码语言:javascript
运行
复制
ip6tables -t nat -A POSTROUTING -s fd00::/80 ! -o docker0 -j MASQUERADE
  1. 使用任何你喜欢的方式来坚持#7

资源:

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/68764905

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档