Java Docker映像生成失败,找不到openjdk-8-jdk版本
我正在尝试构建docker映像,但出现以下错误。此错误首先发生在完成新生成后,手动删除docker windows应用程序中的所有docker映像Java Docker映像生成失败,找不到openjdk-8-jdk版本,java,docker,docker-compose,Java,Docker,Docker Compose,我正在尝试构建docker映像,但出现以下错误。此错误首先发生在完成新生成后,手动删除docker windows应用程序中的所有docker映像 => [ 1/18] FROM docker.io/library/node@sha256:25516f3de85ebf588e29d81052495d2e1177b55cddbd7ddab2f5ff2c4496dd5e 0.0s => [internal] load build context
=> [ 1/18] FROM docker.io/library/node@sha256:25516f3de85ebf588e29d81052495d2e1177b55cddbd7ddab2f5ff2c4496dd5e 0.0s
=> [internal] load build context 0.2s
=> => transferring context: 23.72kB 0.2s
=> CACHED [ 2/18] RUN apt-get update && apt-get install build-essential bzip2 -y 0.0s
=> CACHED [ 3/18] RUN apt-get update && apt-get install -y unzip && rm -rf /var/lib/apt/lists/* 0.0s
=> CACHED [ 4/18] RUN echo 'deb [check-valid-until=no] http://archive.debian.org/debian jessie-backports main' > 0.0s
=> ERROR [ 5/18] RUN set -x && apt-get update && apt-get install -y openjdk-8-jdk="8u292-b10-0+deb9u1" c 133.7s
> [ 5/18] RUN set -x && apt-get update && apt-get install -y openjdk-8-jdk="8u292-b10-0+deb9u1"
ca-certificates-java="20161107~bpo8+1" && rm -rf /var/lib/apt/lists/*:
#8 0.539 + apt-get update
#8 1.131 Get:1 http://deb.debian.org/debian buster InRelease [121 kB]
#8 1.174 Get:2 http://security.debian.org/debian-security buster/updates InRelease [65.4 kB]
#8 1.360 Get:3 http://archive.debian.org/debian jessie-backports InRelease [166 kB]
#8 1.493 Get:4 http://deb.debian.org/debian buster-updates InRelease [51.9 kB]amd64 Packages [285 kB]
#8 1.709 Get:5 http://security.debian.org/debian-security buster/updates/main amd64 Packages [285 kB]
#8 1.906 Get:6 http://deb.debian.org/debian buster/main amd64 Packages [7907 kB]
#8 2.191 Err:3 http://archive.debian.org/debian jessie-backports InReleasec key is not available: NO_PUBKEY 8B48AD62469
#8 2.191 The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 8B48AD6246925553 NO_PUBKEY 7638D0442B90D010
#8 131.6 Get:7 http://deb.debian.org/debian buster-updates/main amd64 Packages [10.9 kB]
#8 132.8 Reading package lists...
#8 133.7 W: GPG error: http://archive.debian.org/debian jessie-backports InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 8B48AD6246925553 NO_PUBKEY 7638D0442B90D010
#8 133.7 E: The repository 'http://archive.debian.org/debian jessie-backports InRelease' is not signed.
executor failed running [/bin/sh -c set -x && apt-get update && apt-get install -y openjdk-8-jdk="$JAVA_DEBIAN_VERSION" ca-certificates-java="$CA_CERTIFICATES_JAVA_VERSION" && rm -rf /var/lib/apt/lists/*]: exit code: 100
ERROR: Service 'simulation-manager' failed to build : Build failed
考虑到缺少签名可能是问题所在,我在dockerfile中添加了以下两行:
RUN apt-key adv --keyserver pgp.mit.edu --recv-keys 7638D0442B90D010 8B48AD6246925553
RUN apt-get update
但是,这产生了以下错误:
=> [ 1/20] FROM docker.io/library/node@sha256:25516f3de85ebf588e29d81052495d2e1177b55cddbd7ddab2f5ff2c4496dd5e 0.0s
=> [internal] load build context 0.1s
=> => transferring context: 26.90kB 0.1s
=> CACHED [ 2/20] RUN apt-get update && apt-get install build-essential bzip2 -y 0.0s
=> CACHED [ 3/20] RUN apt-get update && apt-get install -y unzip && rm -rf /var/lib/apt/lists/* 0.0s
=> CACHED [ 4/20] RUN echo 'deb [check-valid-until=no] http://archive.debian.org/debian jessie-backports main' > /etc/apt/sourc 0.0s
=> [ 5/20] RUN apt-key adv --keyserver pgp.mit.edu --recv-keys 7638D0442B90D010 8B48AD6246925553 3.6s
=> [ 6/20] RUN apt-get update 143.6s
=> ERROR [ 7/20] RUN set -x && apt-get update && apt-get install -y openjdk-8-jdk="8u292-b10-0+deb9u1" ca-certificates-ja 5.4s
> [ 7/20] RUN set -x && apt-get update && apt-get install -y openjdk-8-jdk="8u292-b10-0+deb9u1" ca-certificates-java="20161107~bpo8+1" && rm -rf /var/lib/apt/lists/*:
#10 0.851 + apt-get update
#10 1.172 Hit:1 http://archive.debian.org/debian jessie-backports InRelease
#10 1.173 Hit:2 http://deb.debian.org/debian buster InRelease
#10 1.173 Hit:3 http://security.debian.org/debian-security buster/updates InRelease
#10 1.215 Hit:4 http://deb.debian.org/debian buster-updates InRelease
#10 2.947 Reading package lists...
#10 3.856 + apt-get install -y openjdk-8-jdk=8u292-b10-0+deb9u1 ca-certificates-java=20161107~bpo8+1
#10 3.885 Reading package lists...
#10 5.072 Building dependency tree...
#10 5.273 Reading state information...
#10 5.418 E: Version '8u292-b10-0+deb9u1' for 'openjdk-8-jdk' was not found
executor failed running [/bin/sh -c set -x && apt-get update && apt-get install -y openjdk-8-jdk="$JAVA_DEBIAN_VERSION" ca-certificates-java="$CA_CERTIFICATES_JAVA_VERSION" && rm -rf /var/lib/apt/lists/*]: exit code: 100
ERROR: Service 'simulation-manager' failed to build : Build failed
但是,未找到的版本是以下最新版本(并作为“ENV JAVA_DEBIAN_版本8u292-b10-0+deb9u1”包含在dockerfile中)
任何帮助都将不胜感激 A将很有帮助,不仅仅是
docker构建
日志。一般来说,您不能将APT软件包绑定到非常特定的版本,因为一旦有了更新的版本,Debian和Ubuntu存储库就会非常迅速地删除它们。openjdk-8-jdk仅在Debian Stretch(oldstable)中可用,但您的基本映像使用Debian Buster。因此,您必须明确地将oldstable repo添加到源代码列表中:runecho'debhttp://deb.debian.org/debian-security/ oldstable/updates main'>>/etc/apt/sources.list
运行echo'debhttp://deb.debian.org/debian oldstable main'>>/etc/apt/sources.list
@urfin78这工作非常完美,图像已经构建完成正确地非常感谢您,如果您愿意,您可以添加它作为答案,这样我就可以“接受”它了?这将只起作用,直到Debian Bullsey(今年晚些时候)发布,buster将成为新的oldstable
。我不知道debian stretch(将是Oldstable)存储库在那之后会在线多久,所以更好的解决方案可能是以某种方式适应jdk11或更新的java版本。