Docker node 镜像是否有 ssh-keygen?
我测试了 node:20 和 node:20-alpine,可以确认:
node:20(即基于 debian bookworm)有可用的ssh-keygennode:20-alpine没有ssh-keygen
在 Alpine 上,你可以使用 apk 安装 ssh-keygen。
通常,这意味着你需要基于 node:20-alpine 构建自己的 docker 镜像。在你的 Dockerfile 中,添加
Dockerfile
RUN apk update && \
apk add --no-cache \
openssh-keygenIf this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow