zoukankan      html  css  js  c++  java
  • Ubuntu安装Docker

    当前各系统版本:

    Ubuntu Xenial 16.04 (LTS)

    Docker v18.03.0-ce(CE即Community Edition,EE即Enterprise Edition 总共两个版本)

    教程内容来自:https://docs.docker.com/install/linux/docker-ce/ubuntu/

    以下Docker CE安装教程按照官方的教程一步一步操作完成。文章首次写作时间为2018年4月24日。

    要在Ubuntu上安装Docker CE的操作系统要求,需要64bit的Ubuntu,基于x86_64(例如使用Intel或者AMD的CPU的普通PC),armhf(例如树莓派)等硬件平台。

    如果安装过Docker,需要执行下列命令卸载。

    sudo apt-get remove docker docker-engine docker.io

     如果apt-get报告说没有安装这些软件包就可以了。

    sudo apt-get update
    sudo apt-get install 
        apt-transport-https 
        ca-certificates 
        curl 
        software-properties-common
    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
    sudo apt-key fingerprint 0EBFCD88

    回车后提示

    pub   4096R/0EBFCD88 2017-02-22
          Key fingerprint = 9DC8 5822 9FC7 DD38 854A  E2D8 8D81 803C 0EBF CD88
    uid                  Docker Release (CE deb) <docker@docker.com>
    sub   4096R/F273FCD8 2017-02-22

    x86_64 / amd64平台执行

    sudo add-apt-repository 
       "deb [arch=amd64] https://download.docker.com/linux/ubuntu 
       $(lsb_release -cs) 
       stable"

    armhf(树莓派)平台执行

    sudo add-apt-repository 
       "deb [arch=armhf] https://download.docker.com/linux/ubuntu 
       $(lsb_release -cs) 
       stable"
    sudo apt-get update
    sudo apt-get install docker-ce
    sudo docker run hello-world

    要升级Docker CE,首先运行sudo apt-get update,然后选择要安装的新版本。

    Debian安装请参考连接:https://docs.docker.com/install/linux/docker-ce/debian/#install-docker-ce-1

    2018-07-23更新信息

    中科大的docker镜像源速度很快http://mirrors.ustc.edu.cn/help/docker-ce.html

    在阅读官方安装手册时,只要把 download.docker.com 地址换成 mirrors.ustc.edu.cn/docker-ce 即可。

    curl -fsSL https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
    

    x86_64 / amd64平台执行:

    sudo add-apt-repository 
       "deb [arch=amd64] https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu 
       $(lsb_release -cs) 
       stable"
    

    稳定版本发布:https://docs.docker.com/release-notes/docker-ce/#stable-releases

    https://download.docker.com/linux/ubuntu/dists/bionic/pool/stable/amd64/

    要安装指定版本:sudo apt-get install docker-ce=<VERSION>,

    例如:

    arrive@STK:~$ apt-cache madison docker-ce
     docker-ce | 18.06.0~ce~3-0~ubuntu | https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu bionic/stable amd64 Packages
     docker-ce | 18.03.1~ce~3-0~ubuntu | https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu bionic/stable amd64 Packages
    sudo apt-get install docker-ce=18.03.1~ce~3-0~ubuntu

    升级时忽略docker

    sudo apt-mark hold docker-ce
    sudo apt-mark hold docker-ce-cli
    docker-ce-cli 设置为保留。
    
    sudo apt-mark hold docker-ce
    docker-ce 设置为保留。

    Uninstall the Docker CE package:

    sudo apt-get purge docker-ce

    Images, containers, volumes, or customized configuration files on your host are not automatically removed. To delete all images, containers, and volumes:

    sudo rm -rf /var/lib/docker
  • 相关阅读:
    ASP.NET Core 返回 Json DateTime 格式
    IdentityServer4 SigningCredential(RSA 证书加密)
    IdentityServer4 指定角色授权(Authorize(Roles="admin"))
    ASP.NET Core 指定环境发布(hosting environment)
    ASP.NET Core 使用 Redis 客户端
    IdentityServer4 实现 OAuth 2.0(密码模式
    IdentityServer4 登录成功后,跳转到原来页面
    IdentityServer4 退出登录后,跳转到原来页面
    C#面向插件级别的软件开发
    使用XML序列化实现系统配置
  • 原文地址:https://www.cnblogs.com/arrive/p/8926364.html
Copyright © 2011-2022 走看看