Wik*_*ver 8 ubuntu apt gnupg docker apt-key
我正在尝试在 Docker 中使用 Ubuntu 20 或 Ubuntu 22。我的Dockerfile是:
from ubuntu:22.04
run DEBIAN_FRONTEND=noninteractive apt update
Run Code Online (Sandbox Code Playgroud)
我用 构建这个docker build .。结果是:
Sending build context to Docker daemon 2.048kB
Step 1/2 : from ubuntu:22.04
---> 2dc39ba059dc
Step 2/2 : run DEBIAN_FRONTEND=noninteractive apt update
---> Running in b15002ae9dd5
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
Get:1 http://archive.ubuntu.com/ubuntu jammy InRelease [270 kB]
Get:2 http://security.ubuntu.com/ubuntu jammy-security
InRelease [110 kB]
Get:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [114 kB]
Get:4 http://archive.ubuntu.com/ubuntu jammy-backports InRelease [99.8 kB] Err:1 http://archive.ubuntu.com/ubuntu jammy InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
Run Code Online (Sandbox Code Playgroud)
我多次收到此消息,直到收到:
W: http://archive.ubuntu.com/ubuntu/dists/jammy/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/ubuntu-keyring-2012-cdimage.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
Run Code Online (Sandbox Code Playgroud)
我尝试将其chmod a+rwx /etc/apt -R作为第一个run命令,Dockerfile但没有什么区别。
我也明确运行过docker pull ubuntu:22.04,它说它已经是最新的了。我对图像有完全相同的问题ubuntu:20.04。
我已经咨询了所有其他提到这个问题的网络资源,但它们都要求我能够运行apt install apt-key或其他东西,但我无法更新apt开始,所以没有任何效果,除了搜索引擎点击的前 3 页只是显示如何在 Ubuntu 上安装 Docker,而不是相反。
--security-opt seccomp:unconfined我也按照另一个答案中提到的尝试过。回应为Error response from daemon: The daemon on this platform does not support setting security options on build.
所以我的图像没有curl,wget或者gnupg如果不让它工作,我就无法安装它。当我做任何事情时,apt-key我会得到:E: gnupg, gnupg2 and gnupg1 do not seem to be installed, but one of them is required for this operation
我已成功从 deb 文件手动安装gnupg,并手动接收密钥,这给出了类似的错误消息:
# apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 871920D1991BC93C
Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
Executing: /tmp/apt-key-gpghome.rQuYmKpjpo/gpg.1.sh --keyserver keyserver.ubuntu.com --recv-keys 871920D1991BC93C
gpg: requesting key 991BC93C from hkp server keyserver.ubuntu.com
gpg: key 991BC93C: public key "Ubuntu Archive Automatic Signing Key (2018) <ftpmaster@ubuntu.com>" imported
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
W: The key(s) in the keyring /etc/apt/trusted.gpg.d/ubuntu-keyring-2018-archive.gpg are ignored as the file is not readable by user '' executing apt-key.
Run Code Online (Sandbox Code Playgroud)
我也尝试过将其削减/etc/apt/source.list到最低限度。同样的问题。
如何从主机添加所需的密钥?
作为次要问题,如何打破这样的主流工具和发行版?每个人都转向其他事情了吗?它是什么?我没有良好的互联网接入,因此了解计算机世界的最新动态是一个挑战。
小智 15
只需升级主机上的docker即可。 https://docs.docker.com/engine/install/ubuntu/
这是保护密钥的新系统调用罕见的不兼容性,旧版 Docker 不支持。没有办法给Ubuntu打补丁使其在旧的Docker上工作,我花了半天时间尝试。
| 归档时间: |
|
| 查看次数: |
11993 次 |
| 最近记录: |