我在构建 Docker 容器时遇到错误。 Debian 的 Postgres Stretch 似乎存在问题。我看到 Debian strech 已被删除并且不再受支持。
W: The repository 'http://apt.postgresql.org/pub/repos/apt stretch-pgdg Release' does not have a Release file.
E: Failed to fetch http://apt.postgresql.org/pub/repos/apt/dists/stretch-pgdg/11/binary-amd64/Packages 404 Not Found [IP: 147.75.85.69 80]
E: Some index files failed to download. They have been ignored, or old ones used instead.
ERROR: Service 'db' failed to build: The command '/bin/sh -c apt-get update && apt-get install dos2unix && apt-get clean' returned a non-zero code: 100
我看到 Debian Stretch 不再受支持,所以我认为这是导致此错误的原因。在我的 docker postgresql 文件中,我更改为使用更新的 domething,但我仍然收到以下错误:
在安装 docker 映像期间,我收到以下错误:
#0 14.83 WARNING: The following packages cannot be authenticated!
#0 14.83 libgdbm3 libpopt0 libedit2 libgpm2 libkeyutils1 python-minimal mime-support
#0 14.83 libpython-stdlib python libisl10 libcloog-isl4 libmpdec2 libmpfr4 libxau6
#0 14.83 libxcb1 libxext6 libxmuu1 sgml-base libmpc3 ifupdown less manpages netbase
#0 14.83 libpsl0 python-support xz-utils binutils cpp gcc g++ make libtimedate-perl
#0 14.83 libdpkg-perl dpkg-dev build-essential python3-minimal libpython3-stdlib
#0 14.83 python3 dh-python libfakeroot fakeroot liberror-perl libalgorithm-c3-perl
#0 14.83 libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl
#0 14.83 libarchive-extract-perl libcgi-pm-perl libfcgi-perl libcgi-fast-perl
#0 14.83 libclass-c3-perl libclass-c3-xs-perl libcpan-meta-perl libparams-util-perl
#0 14.83 libsub-install-perl libdata-optlist-perl libmro-compat-perl
#0 14.83 libsub-exporter-perl libdata-section-perl libfile-fcntllock-perl
#0 14.83 libgeos-3.4.2 libgeos-c1 libgeos-dev liblog-message-perl
#0 14.83 liblog-message-simple-perl libmodule-pluggable-perl
#0 14.83 libpackage-constants-perl libpod-latex-perl libregexp-common-perl
#0 14.83 libpod-readme-perl libpython-dev libtext-template-perl
#0 14.83 libsoftware-license-perl libterm-ui-perl libtext-soundex-perl lsb-release
#0 14.83 manpages-dev python-ply python-pycparser python-cffi python-pkg-resources
#0 14.83 python-chardet python3-pkg-resources python-chardet-whl python-colorama
#0 14.83 python-colorama-whl python-six python-cryptography python-dev python-distlib
#0 14.83 python-distlib-whl python-html5lib python-html5lib-whl python-openssl
#0 14.83 python-ndg-httpsclient python-requests python-setuptools python-pip
#0 14.83 python-six-whl python-requests-whl python-setuptools-whl python-pip-whl
#0 14.83 python-pyasn1 python-virtualenv python-wheel python3-virtualenv rename
#0 14.83 virtualenv xauth xml-core
#0 14.83 E: There are problems and -y was used without --force-yes
------
failed to solve: executor failed running [/bin/sh -c apt-get -q -y update && DEBIAN_FRONTEND=noninteractive apt-get -q -y upgrade && apt-get -q -y install python-dev python-pip python-virtualenv python-wheel libpq-dev libxml2-dev libxslt-dev libgeos-dev libssl-dev libffi-dev postgresql-client build-essential git-core vim wget && apt-get -q clean && rm -rf /var/lib/apt/lists/*]: exit code: 100
这是我的 postgresql dockerfile:
FROM FROM postgis11
RUN apt-get update && \
apt-get install dos2unix && \
apt-get clean
# Allow connections; we don't map out any ports so only linked docker containers can connect
RUN echo "host all all 0.0.0.0/0 md5" >> /var/lib/postgresql/data/pg_hba.conf
# Customize default user/pass/db
ENV POSTGRES_DB test
ENV POSTGRES_USER test
ARG POSTGRES_PASSWORD
ARG DS_RO_PASS
# Include datastore setup scripts
COPY ./postgresql/docker-entrypoint-initdb.d /docker-entrypoint-initdb.d
RUN dos2unix /docker-entrypoint-initdb.d/00_create_datastore.sh && apt-get --purge remove -y dos2unix
有人可以帮助我并让我知道在哪里搜索以及问题可能出在哪里吗?
您关于如何让 Docker 在 Debian Stretch 上工作的安装建议没有奏效。无论如何,感谢您的链接。这仅解决了部分问题,这是我在安装后收到的错误:
> [docker-db 2/5] RUN apt-get update && apt-get install dos2unix && apt-get clean:
#0 0.483 Get:1 http://security.debian.org/debian-security stretch/updates InRelease [59.1 kB]
#0 0.485 Ign:2 http://deb.debian.org/debian stretch InRelease
#0 0.498 Get:3 http://deb.debian.org/debian stretch-updates InRelease [93.6 kB]
#0 0.524 Get:4 http://deb.debian.org/debian stretch Release [118 kB]
#0 0.550 Get:5 http://deb.debian.org/debian stretch Release.gpg [3,177 B]
#0 0.555 Ign:6 http://apt.postgresql.org/pub/repos/apt stretch-pgdg InRelease
#0 0.589 Ign:7 http://apt.postgresql.org/pub/repos/apt stretch-pgdg Release
#0 0.611 Get:8 http://security.debian.org/debian-security stretch/updates/main amd64 Packages [782 kB]
#0 0.622 Ign:9 http://apt.postgresql.org/pub/repos/apt stretch-pgdg/main amd64 Packages
#0 0.656 Ign:10 http://apt.postgresql.org/pub/repos/apt stretch-pgdg/11 amd64 Packages
#0 0.693 Ign:11 http://apt.postgresql.org/pub/repos/apt stretch-pgdg/main all Packages
#0 0.725 Ign:12 http://apt.postgresql.org/pub/repos/apt stretch-pgdg/11 all Packages
#0 0.758 Ign:9 http://apt.postgresql.org/pub/repos/apt stretch-pgdg/main amd64 Packages
#0 0.790 Ign:10 http://apt.postgresql.org/pub/repos/apt stretch-pgdg/11 amd64 Packages
#0 0.800 Get:13 http://deb.debian.org/debian stretch/main amd64 Packages [7,080 kB]
#0 0.823 Ign:11 http://apt.postgresql.org/pub/repos/apt stretch-pgdg/main all Packages
#0 0.857 Ign:12 http://apt.postgresql.org/pub/repos/apt stretch-pgdg/11 all Packages
#0 0.894 Ign:9 http://apt.postgresql.org/pub/repos/apt stretch-pgdg/main amd64 Packages
#0 0.926 Ign:10 http://apt.postgresql.org/pub/repos/apt stretch-pgdg/11 amd64 Packages
#0 0.959 Ign:11 http://apt.postgresql.org/pub/repos/apt stretch-pgdg/main all Packages
#0 0.990 Ign:12 http://apt.postgresql.org/pub/repos/apt stretch-pgdg/11 all Packages
#0 1.022 Ign:9 http://apt.postgresql.org/pub/repos/apt stretch-pgdg/main amd64 Packages
#0 1.060 Ign:10 http://apt.postgresql.org/pub/repos/apt stretch-pgdg/11 amd64 Packages
#0 1.093 Ign:11 http://apt.postgresql.org/pub/repos/apt stretch-pgdg/main all Packages
#0 1.125 Ign:12 http://apt.postgresql.org/pub/repos/apt stretch-pgdg/11 all Packages
#0 1.159 Ign:9 http://apt.postgresql.org/pub/repos/apt stretch-pgdg/main amd64 Packages
#0 1.194 Ign:10 http://apt.postgresql.org/pub/repos/apt stretch-pgdg/11 amd64 Packages
#0 1.226 Ign:11 http://apt.postgresql.org/pub/repos/apt stretch-pgdg/main all Packages
#0 1.258 Ign:12 http://apt.postgresql.org/pub/repos/apt stretch-pgdg/11 all Packages
#0 1.292 Err:9 http://apt.postgresql.org/pub/repos/apt stretch-pgdg/main amd64 Packages
#0 1.292 404 Not Found [IP: 147.75.85.69 80]
#0 1.324 Ign:10 http://apt.postgresql.org/pub/repos/apt stretch-pgdg/11 amd64 Packages
#0 1.357 Ign:11 http://apt.postgresql.org/pub/repos/apt stretch-pgdg/main all Packages
#0 1.389 Ign:12 http://apt.postgresql.org/pub/repos/apt stretch-pgdg/11 all Packages
#0 3.674 Fetched 8,135 kB in 3s (2,519 kB/s)
#0 3.674 Reading package lists...
#0 4.359 W: The repository 'http://apt.postgresql.org/pub/repos/apt stretch-pgdg Release' does not have a Release file.
#0 4.359 E: Failed to fetch http://apt.postgresql.org/pub/repos/apt/dists/stretch-pgdg/main/binary-amd64/Packages 404 Not Found [IP: 147.75.85.69 80]
#0 4.359 E: Some index files failed to download. They have been ignored, or old ones used instead.
------
failed to solve: executor failed running [/bin/sh -c apt-get update && apt-get install dos2unix && apt-get clean]: exit code: 100