以下是docker文件:
ENV CA_CERTIFICATES_JAVA_VERSION 20140324
RUN 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/* \
&& [ "$JAVA_HOME" = "$(docker-java-home)" ]
出现错误:
Step 16/26 : RUN 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/* && [ "$JAVA_HOME" = "$(docker-java-home)" ]
---> Running in 6d823a145982
+ apt-get update
Get:1 https://apt.dockerproject.org debian-jessie InRelease [48.7 kB]
Get:2 http://archive.debian.org jessie-backports InRelease [166 kB]
Get:3 https://apt.dockerproject.org debian-jessie/main amd64 Packages [7366 B]
Get:4 http://security.debian.org jessie/updates InRelease [44.9 kB]
Ign http://deb.debian.org jessie InRelease
Get:5 http://deb.debian.org jessie-updates InRelease [16.3 kB]
Get:6 http://archive.debian.org jessie-backports/main amd64 Packages [1171 kB]
Get:7 http://deb.debian.org jessie Release.gpg [1652 B]
Get:8 http://deb.debian.org jessie Release [77.3 kB]
Get:9 http://security.debian.org jessie/updates/main amd64 Packages [892 kB]
Get:10 http://deb.debian.org jessie-updates/main amd64 Packages [20 B]
Get:11 http://deb.debian.org jessie/main amd64 Packages [9098 kB]
Fetched 11.5 MB in 14s (803 kB/s)
Reading package lists...
+ apt-get install -y openjdk-8-jdk=8u171-b11-1~bpo8+1 ca-certificates-java=20140324
Reading package lists...
Building dependency tree...
Reading state information...
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
openjdk-8-jdk : Depends: openjdk-8-jre (= 8u171-b11-1~bpo8+1) but it is not going to be installed
Depends: openjdk-8-jdk-headless (= 8u171-b11-1~bpo8+1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
ERROR: Service 'slavedotnet' failed to build: The command '/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/* && [ "$JAVA_HOME" = "$(docker-java-home)" ]' returned a non-zero code: 100
如何解决这个依赖问题?
答案1
您无法解决它,因为它openjdk-8-jre-headless
破坏了ca-certificates-java
早于 20160321 的版本。
不过我认为你不需要解决这个问题:
apt-get install -y -t jessie-backports openjdk-8-jdk
运行良好,并且生成的设置确实有一个/etc/ssl/certs/java/cacerts
文件。