gpt4 book ai didi

java - 在docker文件中下载open java sdk

转载 作者:太空宇宙 更新时间:2023-11-04 09:12:06 24 4
gpt4 key购买 nike

我绝对是 linux 和 docker 的菜鸟,我只是想边做边学。我正在创建一个 docker 文件来运行 xamarin build 机器,但我在安装 Open Java sdk 时遇到了困难。单声道运行时似乎安装正确。

FROM debian:stretch-slim

RUN apt-get update && \
apt-get install curl unzip java-1.8.0-openjdk-headless java-1.8.0-
openjdk-devel -y && \
apt-get clean all

错误

Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package java-1.8.0-openjdk-headless
E: Couldn't find any package by glob 'java-1.8.0-openjdk-headless'
E: Couldn't find any package by regex 'java-1.8.0-openjdk-headless'
E: Unable to locate package java-1.8.0-openjdk-devel
E: Couldn't find any package by glob 'java-1.8.0-openjdk-devel'
E: Couldn't find any package by regex 'java-1.8.0-openjdk-devel'
The command '/bin/sh -c apt-get update && apt-get install curl
unzip java-1.8.0-openjdk-headless java-1.8.0-openjdk-devel -y &&
apt-get clean all' returned a non-zero code: 100

注意:为了便于阅读,我删除了 Mono 安装代码。

如果您能告诉我导致问题的原因以及如何解决,我将不胜感激。

最佳答案

我认为 debian:stretch-slim 和 openjdk-8 包括 openjdk-8-jre-headless 存在一些问题,请尝试使用最新的 debian FROM debian:latest 或标记 7-slim

关于java - 在docker文件中下载open java sdk,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54021629/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com