• 虚拟机 之 docker使用


    一、安装:

    Ubuntu:

      1.1 从docker官方源安装最新版本:

        sudo apt-get install apt-transport-https

     ActionScript Code 
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
     
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    apt-transport-https 
    is already the newest version (1.2.24).
    The following packages were automatically installed 
    and are no longer required:
      linux-headers-
    4.4.0-21 linux-headers-4.4.0-21-generic linux-headers-4.4.0-75 linux-headers-4.4.0-75-generic linux-headers-4.4.0-78
      linux-headers-
    4.4.0-78-generic linux-headers-4.4.0-79 linux-headers-4.4.0-79-generic linux-headers-4.4.0-81 linux-headers-4.4.0-81-generic
      linux-headers-
    4.4.0-83 linux-headers-4.4.0-83-generic linux-image-4.4.0-21-generic linux-image-4.4.0-75-generic linux-image-4.4.0-78-generic
      linux-image-
    4.4.0-79-generic linux-image-4.4.0-81-generic linux-image-4.4.0-83-generic linux-image-extra-4.4.0-21-generic
      linux-image-extra-
    4.4.0-75-generic linux-image-extra-4.4.0-78-generic linux-image-extra-4.4.0-79-generic linux-image-extra-4.4.0-81-generic
      linux-image-extra-
    4.4.0-83-generic
    Use 
    'sudo apt autoremove' to remove them.
    0 upgraded, 0 newly installed, 0 to remove and 249 not upgraded.

         sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9

     ActionScript Code 
    1
    2
    3
    4
    5
    6
    7
    8
    9
     
    Executing: /tmp/tmp.NKp2Vggwce/gpg.1.sh --keyserver
    hkp:
    //keyserver.ubuntu.com:80
    --recv-keys
    36A1D7869245C8950F966E92D8576A8BA88D21E9
    gpg: requesting key A88D21E9 from hkp server keyserver.ubuntu.com
    gpg: key A88D21E9: 
    public key "Docker Release Tool (releasedocker) <docker@dotcloud.com>" imported
    gpg: Total number processed: 
    1
    gpg:               imported: 
    1  (RSA: 1)

        sudo bash -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"

        sudo apt-get update

     ActionScript Code 
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
     
    Hit:1 http://archive.ubuntukylin.com:10006/ubuntukylin trusty InRelease
    Hit:2 http://security.ubuntu.com/ubuntu xenial-security InRelease                                                                    
    Hit:3 http://us.archive.ubuntu.com/ubuntu xenial InRelease
    Get:4 http://us.archive.ubuntu.com/ubuntu xenial-updates InRelease [102 kB]
    Get:5 http://us.archive.ubuntu.com/ubuntu xenial-backports InRelease [102 kB]
    Ign:6 https://get.docker.io/ubuntu docker InRelease                                                                                                   
    Get:7 https://get.docker.io/ubuntu docker Release [1,525 B]                                                                                           
    Get:8 https://get.docker.io/ubuntu docker Release.gpg [473 B]
    Fetched 206 kB in 15s (13.2 kB/s)
    Reading 
    package lists... Done
    W: https:
    //get.docker.io/ubuntu/dists/docker/Release.gpg: Signature by key 36A1D7869245C8950F966E92D8576A8BA88D21E9 uses weak digest algorithm (SHA1)

        错误:

     ActionScript Code 
    1
    2
    3
    4
    5
    6
     
    liuzw@ubuntu:/home$ sudo apt-get install -y lxc-docker
    Reading 
    package lists... Done
    Building dependency tree       
    Reading state information... Done
    E: Unable to locate 
    package lxc-docker

         解决办法:

          更新软件源

  • 相关阅读:
    LeetCode (160) Intersection of Two Linked Lists
    cmake命令 安装、用法简介
    算法——回文解密,判断一个数组是否为回文
    发现一个好用的播放插件---ckplayer
    阿里云ESC上的Ubuntu图形界面的安装
    tomcat 启动本地项目,但是报错的是另一个项目错误导致的tomcat启动失败
    发现一个有趣的时间控件
    Comparator 排序优先级
    项目Exception,项目前面有红色的小叉×
    日常问题,JasperException
  • 原文地址:https://www.cnblogs.com/pokerface/p/8037145.html
Copyright © 2020-2023  润新知