1. 程式人生 > >在ubuntu中安裝docker

在ubuntu中安裝docker

docker 支援的Ubuntu版本:   Ubuntu Trusty 14.04(LTS)(64-bit)   Ubuntu Precise 12.04(LTS)(64-bit)   Ubuntu Raring 13.04 and Saucy 13.10(64-bit)

安裝前檢查: 1、核心版本:        uname -a 2、檢查Device Mapper:        ls -l /sys/class/misc/device-mapper

Ubuntu中安裝Docker的方式 1、安裝Ubuntu維護的版本 2、安裝Docker維護的版本

安裝 Ubuntu維護的版本: 1、 sudo apt-get install docker.io 2、 source /etc/bash_completion.d/docker.io

安裝Docker維護的版本: 1、檢查APT的HTTPS支援  檢視/usr/lib/apt/methods/https檔案是否存在       如果不存在,執行安裝命令

      apt-get update         apt-get install -y apt-transport-https

2、新增Docker的APT倉庫       echo deb https://get.docker.com/ubuntu docker main >       /etc/apt/sources.list.d/docker.list

3、新增倉庫的key      apt-key adv --keyserver hkp://keyserver.ubuntu.com;80      --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9

4、安裝      apt-get update

將上述四個步驟寫在一個shell指令碼中,就上述的命令寫在curl中

sudo apt-get install -y curl

curl -sSL https://get.docker.com/ubuntu/ | sudo sh

檢視是否安裝了curl whereis curl   使用非root使用者:   1、sudo groupadd docker   2、sudo gpasswd -a ${USER} docker   3、sudo service docker restart