我在DockerFile中有以下命令
# 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
如果出现以下错误,它将失败:
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您将下载该文件。
这过去很管用,但现在不行了。有什么想法吗?
发布于 2021-08-16 19:39:00
对我来说,这个特别的问题与互联网接入无关,因为apt-get更新很好,gis ppa不知怎么坏了,坦率地说,您不再需要它与18.04的LTS图像,也许默认的18.04图像已经更新。
删除
RUN add-apt-repository ppa:ubuntugis/ppa
发布于 2021-08-16 05:49:48
在我的例子中,问题是没有从我的码头容器中启用ipv6,而且所讨论的ppa (ondre/php)肯定已经开始执行它了。这使我花了一个星期的时间把头撞在墙上。实际上,我重新启动了我的笔记本电脑很多次,我遇到了Ubuntu臭名昭著的、持续的、低亮度的错误--但这是另一个故事。所以,在包扎我的头,打个盹,休息一下,祈祷之后,我做了些什么来解决这个问题:
后面列出的资源
systemctl stop docker
/etc/docker
文件并添加以下内容:{
"data-root": "/home/user/docker/data",
"ipv6": true,
"fixed-cidr-v6": "fd00::/80"
}
最后两个属性是您关注的重点。
systemctl start docker
。此时,您应该没有码头错误。ip6tables -t nat -A POSTROUTING -s fd00::/80 ! -o docker0 -j MASQUERADE
资源:
https://stackoverflow.com/questions/68764905
复制相似问题