2015-02-07 37 views
3

今天我升級碼頭成功,遵循指示:https://askubuntu.com/questions/472412/how-do-i-upgrade-docker爲什麼「https://get.docker.com/ubuntu」是一個apt存儲庫?

但是,當我在瀏覽器中打開存儲庫URL https://get.docker.com/ubuntu/時,它只是一個文本頁面,其中包含一個bash commands的列表。

我的問題是:

這個文本頁面URL作品
  • 如何貼切呢?

  • apt是否只運行bash命令?

  • 如果是這樣,爲什麼會出現同一 命令:

echo deb https://get.docker.com/ubuntu docker main > /etc/apt/sources.list.d/docker.list

如在 https://askubuntu.com/questions/472412/how-do-i-upgrade-docker

回答

5

位於https://get.docker.com/ubuntu/該頁面包含可用於安裝搬運工

# Check that HTTPS transport is available to APT 
if [ ! -e /usr/lib/apt/methods/https ]; then 
    apt-get update 
    apt-get install -y apt-transport-https 
fi 

# Add the repository to your APT sources 
echo deb https://get.docker.com/ubuntu docker main > /etc/apt/sources.list.d/docker.list 

# Then import the repository key 
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9 

# Install docker 
apt-get update 
apt-get install -y lxc-docker 

腳本但這腳本不是apt-get使用,則必須手動運行。

deb https://get.docker.com/ubuntu docker main 

apt-get update運行時,此配置文件將被使用,apt-get update將採取該行並從中

構建以下網址:

腳本使用以下內容創建配置文件/etc/apt/sources.list.d/docker.list

https://get.docker.com/ubuntu/dists/docker/main/binary-amd64/Packages 

包管理系統的包緩存將使用Packages文件中描述的包進行更新。

Package: lxc-docker 
Version: 1.5.0 
License: Apache-2.0 
Vendor: none 
Architecture: amd64 
Maintainer: [email protected] 
Installed-Size: 0 
Depends: lxc-docker-1.5.0 
Homepage: http://www.docker.com/ 
Priority: extra 
Section: default 
Filename: pool/main/l/lxc-docker/lxc-docker_1.5.0_amd64.deb 
Size: 2092 
SHA256: 2e8b061216cc45343197e52082175bc671af298d530652436dc16d0397f986f0 
SHA1: 24a0314bd7f6fdf79b69720de60be77510d689af 
MD5sum: 923cad1a2af2d6b0a3e8fa909ba26ca4 
Description: Linux container runtime Docker complements LXC with a high-level API which operates at the process level. It runs unix processes with strong guarantees of isolation and repeatability across servers. Docker is a great building block for automating distributed systems: large-scale web deployments, database clusters, continuous deployment systems, private PaaS, service-oriented architectures, etc. 
.... 

最後apt-get upgrade將下載並安裝軟件包。

-2

如果我沒有記錯的話(我還是新到Linux),
sudo sh -c "echo deb http://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
它複製中的文本文件然後將其粘貼到etc/apt/sources.list.d/docker.list。然後執行shell文件。

+1

這仍然不能解釋如何知道存儲庫。 – Guocheng 2015-02-07 13:50:02

+0

您的聲明錯誤,'echo'命令不會複製'http:// get.docker.io/ubuntu'中的文本文件。 – 2015-02-24 11:30:15

相關問題