gpt4 book ai didi

docker - 在 docker 镜像中安装 sdkman

转载 作者:行者123 更新时间:2023-12-02 20:33:52 26 4
gpt4 key购买 nike

安装时出错 SDKMAN!Ubuntu 16.04 docker 形象。

FROM ubuntu:16.04
RUN apt-get update
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
RUN apt-get -qq -y install curl
RUN curl -s https://get.sdkman.io | bash
RUN chmod a+x "$HOME/.sdkman/bin/sdkman-init.sh"
RUN source "$HOME/.sdkman/bin/sdkman-init.sh"

最佳答案

TL;博士
安装 unzip & zip , 这意味着改变

RUN apt-get -qq -y install curl
RUN apt-get -qq -y install curl unzip zip
或更好
RUN apt-get -qq -y install \
curl \
unzip \
zip

解释
当你尝试构建 Dockerfile 时,你会得到
    .....

Step 5/6 : RUN curl -s https://get.sdkman.io | bash
---> Running in 1ce678a59561

--- SDKMAN LOGO ---

Now attempting installation...

Looking for a previous installation of SDKMAN...
Looking for unzip...
Not found.
======================================================================================================
Please install unzip on your system using your favourite package manager.

Restart after installing unzip.
======================================================================================================

Removing intermediate container 1ce678a59561
---> 22211eafd50c
Step 6/6 : RUN source "$HOME/.sdkman/bin/sdkman-init.sh"
---> Running in 1c5cb7d79ef0
/bin/sh: /root/.sdkman/bin/sdkman-init.sh: No such file or directory
The command '/bin/sh -c source "$HOME/.sdkman/bin/sdkman-init.sh"' returned a non-zero code: 1
你需要做的就写在那里。这部分:
    ======================================================================================================
Please install unzip on your system using your favourite package manager.

Restart after installing unzip.
======================================================================================================
安装 unzip 时,您会收到与 zip 相同的错误。安装后,一切正常。
因此,请阅读您的日志/命令输出。 :-)

*附注最好是 curl -s https://get.sdkman.io | bash以非零代码退出。这样它会在下一个命令上失败。但这不是您可以解决的问题 ;) *

关于docker - 在 docker 镜像中安装 sdkman,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53656537/

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