微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

在 docker 文件上安装纱线:gpg:[不知道]:部分长度对数据包类型 63 无效

如何解决在 docker 文件上安装纱线:gpg:[不知道]:部分长度对数据包类型 63 无效

我在安装 Yarn 时遇到了更多问题。 Install yarn global on Docker file

在我的最后一个问题中,我找到了在首次构建映像后运行但运行失败的步骤。

Dockerfile

FROM ruby:2.7.2
SHELL ["/bin/bash","-c"]

RUN apt-get update -qq && \
  apt-get install -y nodejs libvips-tools libsodium-dev

# We need Chromedriver.
# RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \
#   echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list && \
#   apt-get install -y google-chrome-stable && \
#   CHROMEVER=$(google-chrome --product-version | grep -o "[^\.]*\.[^\.]*\.[^\.]*") && \
#   DRIVERVER=$(curl -s "https://chromedriver.storage.googleapis.com/LATEST_RELEASE_$CHROMEVER") && \
#   wget -q --continue -P /chromedriver "http://chromedriver.storage.googleapis.com/$DRIVERVER/chromedriver_linux64.zip" && \
#   unzip /chromedriver/chromedriver* -d /chromedriver

# Install all gems first.
# This hits the warm cache if unchanged so bundling is faster.
copY Gemfile* /tmp/
workdir /tmp
RUN bundle install

workdir /sapco
copY . /sapco

RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - # This line fails
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
RUN apt-get update && apt-get install -y yarn
RUN yarn global add mjml

错误输出为:

------
#13 0.362 Warning: apt-key output should not be parsed (stdout is not a terminal)
#13 0.377 gpg: [don't kNow]: partial length invalid for packet type 63
#13 0.377 gpg: read_block: read error: Invalid packet
#13 0.377 gpg: import from '-' Failed: Invalid keyring
------

我能够运行,所以我认为这与 gpg 不工作有太大关系。

RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add ```

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。