subaru-hello / Zeroken

一軒目に飲むお酒と飲む順番を提供するアプリ
5 stars 0 forks source link

apt-keyを無くす #135

Closed subaru-hello closed 1 year ago

subaru-hello commented 2 years ago
$ docker compose build
[+] Building 3.5s (6/15)                                                                                                                                                                                              
 => [internal] load build definition from Dockerfile                                                                                                                                                             0.0s
 => => transferring dockerfile: 32B                                                                                                                                                                              0.0s
 => [internal] load .dockerignore                                                                                                                                                                                0.0s
 => => transferring context: 34B                                                                                                                                                                                 0.0s
 => [internal] load metadata for docker.io/library/ruby:2.6.6                                                                                                                                                    2.8s
 => [auth] library/ruby:pull token for registry-1.docker.io                                                                                                                                                      0.0s
 => CACHED [ 1/10] FROM docker.io/library/ruby:2.6.6@sha256:ee53ac01b7ec7d8d42f53175ed33c39474d40d4af43cccc13cb3370cef586845                                                                                     0.6s
 => [internal] load build context                                                                                                                                                                                0.1s
 => => transferring context: 75.30kB                                                                                                                                                                             0.1s
 => ERROR [ 2/10] RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -     && echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list     && apt-get upd  0.6s
------                                                                                                                                                                                                                
 > [ 2/10] RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -     && echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list     && apt-get update -qq     && apt-get install -y nodejs yarn     && mkdir -p /Zeroken:
#0 0.231 Warning: apt-key output should not be parsed (stdout is not a terminal)
#0 0.559 gpg: Segmentation fault
#0 0.559 no valid OpenPGP data found.
------
failed to solve: executor failed running [/bin/sh -c curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -     && echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list     && apt-get update -qq     && apt-get install -y nodejs yarn     && mkdir -p /Zeroken]: exit code: 2
subaru-hello commented 2 years ago

apy-keyが非推奨だという記事が多数ある

理由

  1. パッケージの正当性を担保するため。 今回aptが示している「パッケージの正当性」とは、本来のリポジトリとは別の場所からインストールしていないことと記されている

そもそも apt, gpgとは

gpgとは

GNU Privacy Guard (GnuPG, GPG)の略で暗号化ソフトウェア

取得した公開鍵の正当性をチェックしている https://qiita.com/y518gaku/items/435838097c700bbe6d1b

参考文献 

http://manpages.ubuntu.com/manpages/jammy/en/man8/apt-key.8.html