Ubuntu 16.04安裝docker

今天單位要在板子上安裝docker,以前是在centos上裝的docker,可是板子上是ubuntu 16.04, 因此今天再學習一下。linux

Ubuntu 16.04安裝dockerdocker

  • 更新apt包索引:
    $ sudo apt-get update
    安裝如下包以使apt能夠經過HTTPS使用存儲庫(repository):
    $ sudo apt-get install -y apt-transport-https ca-certificates curl software-properties-common
    添加Docker官方的GPG密鑰:
    $ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
    使用下面的命令來設置stable存儲庫:
    $ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
    再更新一下apt包索引:
    $ sudo apt-get update
    安裝最新版本的Docker CE:
    $ sudo apt-get install -y docker-cejson

  • 驗證docker
    查看docker服務是否啓動:
    $ systemctl status docker

    報錯

    ubuntu

  •  

  • 解決:
  • vi /etc/docker/daemon.jsoncentos

    { "graph": "/mnt/docker-data", "storage-driver": "overlay"}
    curl

    rm -rf /var/lib/docker學習

相關文章
相關標籤/搜索