簡體   English   中英

Windows 10:Docker 構建在需要 403 身份驗證的 apt-get 升級上失敗

[英]Windows 10: Docker build fails on apt-get upgrade with 403 authenticationrequired

我正在嘗試在我的工作機器上為 php 5.6 應用程序構建一個 docker 圖像。 Dockerfile 的初始步驟如下:

FROM php:5.6-apache

RUN set -x \
    && apt-get update \
    && apt-get upgrade -y

當我運行 docker 構建時,我得到以下 output 以及 apt-get upgrade 命令后的錯誤:

#5 0.365 + apt-get update
#5 0.965 Get:1 http://security.debian.org/debian-security stretch/updates InRelease [59.1 kB]
#5 0.977 Ign:2 http://deb.debian.org/debian stretch InRelease
#5 1.223 Get:3 http://deb.debian.org/debian stretch-updates InRelease [93.6 kB]
#5 1.318 Get:4 http://security.debian.org/debian-security stretch/updates/main amd64 Packages [782 kB]
#5 1.478 Get:5 http://deb.debian.org/debian stretch Release [118 kB]
#5 1.784 Get:6 http://deb.debian.org/debian stretch Release.gpg [3177 B]
#5 1.999 Get:7 http://deb.debian.org/debian stretch/main amd64 Packages [7080 kB]
#5 5.073 Fetched 8135 kB in 4s (1742 kB/s)
#5 5.073 Reading package lists...
#5 5.686 + apt-get upgrade -y
#5 5.701 Reading package lists...
#5 6.318 Building dependency tree...
#5 6.433 Reading state information...
#5 6.444 Calculating upgrade...
#5 6.733 The following packages will be upgraded:
#5 6.733   apache2 apache2-bin apache2-data apache2-utils apt base-files
#5 6.733   ca-certificates curl debian-archive-keyring dpkg dpkg-dev e2fslibs e2fsprogs
#5 6.733   file gpgv gzip libapr1 libapt-pkg5.0 libbsd0 libc-bin libc-dev-bin libc6
#5 6.733   libc6-dev libcomerr2 libcurl3 libdpkg-perl libexpat1 libgcrypt20
#5 6.733   libglib2.0-0 libgmp10 libgnutls30 libgssapi-krb5-2 libhogweed4 libicu57
#5 6.733   libidn11 libk5crypto3 libkrb5-3 libkrb5support0 libldap-2.4-2 libldap-common
#5 6.733   liblz4-1 liblzma5 libmagic-mgc libmagic1 libnettle6 libnghttp2-14
#5 6.733   libp11-kit0 libperl5.24 libsasl2-2 libsasl2-modules-db libsqlite3-0 libss2
#5 6.733   libssh2-1 libssl1.0.2 libssl1.1 libsystemd0 libudev1 libxml2 linux-libc-dev
#5 6.733   login multiarch-support openssl passwd patch perl perl-base
#5 6.733   perl-modules-5.24 tar tzdata xz-utils zlib1g
#5 7.050 71 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
#5 7.050 Need to get 51.0 MB of archives.
#5 7.050 After this operation, 505 kB of additional disk space will be used.
#5 7.050 Get:1 http://security.debian.org/debian-security stretch/updates/main amd64 tar amd64 1.29b-1.1+deb9u1 [760 kB]
#5 7.062 Get:2 http://deb.debian.org/debian stretch/main amd64 base-files amd64 9.9+deb9u13 [67.6 kB]
#5 7.315 Get:3 http://deb.debian.org/debian stretch/main amd64 libc6-dev amd64 2.24-11+deb9u4 [2364 kB]
#5 8.159 Err:4 http://deb.debian.org/debian stretch/main amd64 libc-dev-bin amd64 2.24-11+deb9u4
#5 8.159   403  authenticationrequired
...
...
#5 9.424 Failed to fetch http://deb.debian.org/debian/pool/main/g/glibc/libc6_2.24-11+deb9u4_amd64.deb  403  authenticationrequired
#5 9.424 E: Failed to fetch http://security.debian.org/debian-security/pool/updates/main/e/e2fsprogs/e2fslibs_1.43.4-2+deb9u2_amd64.deb  403  authenticationrequired [IP: 151.101.194.132 80]
#5 9.424 E: Failed to fetch http://security.debian.org/debian-security/pool/updates/main/e/e2fsprogs/e2fsprogs_1.43.4-2+deb9u2_amd64.deb  403  authenticationrequired [IP: 151.101.194.132 80]
...
...

我知道我的 docker 設置缺少配置,但不確定是什么。 我嘗試用 wsl 安裝 Docker,卸載它並用 Hyper V 再次安裝,但同樣的問題。 任何有用的指針?

解決方法是在 windows 上的 WSL 實例(我使用的是 ubuntu)上安裝 docker CE。關閉主機 windows 機器上的 docker 桌面。 然后在 WSL 上構建映像並將其推送到您的 docker 注冊表。 這樣圖像就可以在任何地方使用。 不知道為什么,但 docker 桌面在這種情況下不是很有用。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM