Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要在基于 Alpine 的 docker 映像中安装 Sdkman,但存在一个问题,即默认 shell 不是 Bash。然后命令:
source "$HOME/.sdkman/bin/sdkman-init.sh"
以失败告终:
/bin/sh: /root/.sdkman/bin/sdkman-init.sh: line 40: SDKMAN_PLATFORM+=64: not found
您需要将 SDKMAN 的安装和运行 init 脚本分成两个 RUN 块,例如
RUN apk add bash curl git zip && \ curl -s "https://get.sdkman.io" | bash RUN bash -c "source $HOME/.sdkman/bin/sdkman-init.sh && sdk version"
来源:https ://e.printstacktrace.blog/using-sdkman-as-a-docker-image-for-jenkins-pipeline-a-step-by-step-guide/