“curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add – “我们应该在这里添加一些密钥?

我正试图在Ubuntu上安装docker,并遵循安装指南,我遇到了这个命令。

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

在它的响应中,我确定没有任何真正的下载。 我想提供一个关键或这个curl命令的目的是什么。

apt-key add为docker仓库添加一个可信密钥。 curl命令正在下载该密钥并将其pipe道传输到apt-key add命令,该命令将其添加为可信密钥。

 >man apt-key COMMANDS Add filename Add a new key to the list of trusted keys. The key is read from the filename given with the parameter filename or if the filename is - from standard input. It is critical that keys added manually via apt-key are verified to belong to the owner of the repositories they claim to be for otherwise the apt- secure(8) infrastructure is completely undermined. 

简而言之,该命令将密钥下载为可信密钥。