【发布时间】:2021-07-28 09:22:02
【问题描述】:
我想在我的 Dockerfile 中安装带有 yarn.pkg 的 Node.js。
Dockerfile 用于 Laravel8/PHP8 项目。
这是我的实际尝试:
RUN curl -sL https://deb.nodesource.com/setup_16.x | bash -
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
&& echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list
RUN apt-get update -y \
&& apt-get install -y --no-install-recommends \
nodejs \
yarn \
mysql-client
如果我以这种方式尝试,我的 shell 会得到以下输出:
=> CACHED [ 8/20] RUN curl -sL https://deb.nodesource.com/setup_16.x | bash - 0.0s
=> ERROR [ 9/20] RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - 0.4s
------
> [ 9/20] RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -:
#12 0.331 Warning: apt-key output should not be parsed (stdout is not a terminal)
#12 0.384 gpg: Segmentation fault
#12 0.384 no valid OpenPGP data found.
------
failed to solve: rpc error: code = Unknown desc = executor failed running [/bin/sh -c curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -]: exit code: 2
有没有办法解决这个问题?
如果您需要有关它的更多信息,请告诉我。
问候,
曼尼
【问题讨论】:
-
由于这个问题与 PHP 或 Laravel 无关,请删除这些标签。
-
完成!谢谢你的提示。
标签: node.js dockerfile yarnpkg