浏览代码

Merge pull request #3361 from zimbatm/gpg-key-secure-best

Makes sure the GPG fingerprint is inlined in the doc everywhere.
Tianon Gravi 11 年之前
父节点
当前提交
a25a80b2d3

+ 1 - 1
Vagrantfile

@@ -24,7 +24,7 @@ if [ -z "$user" ]; then
 fi
 
 # Adding an apt gpg key is idempotent.
-wget -q -O - https://get.docker.io/gpg | apt-key add -
+apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
 
 # Creating the docker.list file is idempotent, but it may overwrite desired
 # settings if it already exists.  This could be solved with md5sum but it

+ 4 - 8
docs/sources/installation/ubuntulinux.rst

@@ -68,13 +68,11 @@ easy. **See the :ref:`installmirrors` section below if you are not in
 the United States.** Other sources of the Debian packages may be
 faster for you to install.
 
-First add the Docker repository key to your local keychain. You can use the
-``apt-key`` command to check the fingerprint matches: ``36A1 D786 9245 C895 0F96
-6E92 D857 6A8B A88D 21E9``
+First add the Docker repository key to your local keychain.
 
 .. code-block:: bash
 
-   sudo sh -c "wget -qO- https://get.docker.io/gpg | apt-key add -"
+   sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
 
 Add the Docker repository to your apt sources list, update and install the
 ``lxc-docker`` package.
@@ -142,13 +140,11 @@ Docker is available as a Debian package, which makes installation easy.
     Please note that these instructions have changed for 0.6. If you are upgrading from an earlier version, you will need
     to follow them again.
 
-First add the Docker repository key to your local keychain. You can use the
-``apt-key`` command to check the fingerprint matches: ``36A1 D786 9245 C895 0F96
-6E92 D857 6A8B A88D 21E9``
+First add the Docker repository key to your local keychain.
 
 .. code-block:: bash
 
-   sudo sh -c "wget -qO- https://get.docker.io/gpg | apt-key add -"
+   sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
 
 Add the Docker repository to your apt sources list, update and install the
 ``lxc-docker`` package.

+ 1 - 1
docs/sources/installation/upgrading.rst

@@ -26,7 +26,7 @@ use ``apt-get`` to upgrade.
 .. code-block:: bash
 
    # Add the Docker repository key to your local keychain
-   sudo sh -c "curl https://get.docker.io/gpg | apt-key add -"
+   sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
 
    # Add the Docker repository to your apt sources list.
    sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"

+ 1 - 1
hack/infrastructure/docker-ci/deployment.py

@@ -127,7 +127,7 @@ call('/usr/bin/rsync -aH {} {}@{}:{}'.format(DOCKER_CI_PATH, DO_IMAGE_USER, ip,
 
 # Install Docker and Buildbot dependencies
 sudo('mkdir /mnt/docker; ln -s /mnt/docker /var/lib/docker')
-sudo('wget -q -O - https://get.docker.io/gpg | apt-key add -')
+sudo('apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9')
 sudo('echo deb https://get.docker.io/ubuntu docker main >'
     ' /etc/apt/sources.list.d/docker.list')
 sudo('echo -e "deb http://archive.ubuntu.com/ubuntu raring main universe\n'

+ 5 - 1
hack/install.sh

@@ -108,7 +108,11 @@ case "$lsb_dist" in
 		fi
 		(
 			set -x
-			$sh_c "$curl ${url}gpg | apt-key add -"
+			if [ "https://get.docker.io/" = "$url" ]; then
+				$sh_c "apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9"
+			else
+				$sh_c "$curl ${url}gpg | apt-key add -"
+			fi
 			$sh_c "echo deb ${url}ubuntu docker main > /etc/apt/sources.list.d/docker.list"
 			$sh_c 'sleep 3; apt-get update; apt-get install -y -q lxc-docker'
 		)

+ 1 - 1
hack/release.sh

@@ -245,7 +245,7 @@ EOF
 # Add the repository to your APT sources
 echo deb $(s3_url)/ubuntu docker main > /etc/apt/sources.list.d/docker.list
 # Then import the repository key
-curl $(s3_url)/gpg | apt-key add -
+apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
 # Install docker
 apt-get update ; apt-get install -y lxc-docker