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

    学习Docker之前要先安装好,下面来谈谈安装步骤,本人直接copy官网上的安装步骤,只不过将各个步骤编写成了一个Shell文件(最底下),直接执行即可,只需要注意以下地方
    1.输入docker-ce的版本号

    这里需要copy上面展示出的版本号,然后粘贴后按enter键
    2.对于询问的地方,直接输入Y

    据统计,出现确认的地方应该有两处,最后出现如下输出就表示安装好了docker容器

    3.如果执行脚本文件的时候出现错误,如:

    line 1: $'
    ': command not found
    


    这是因为在windows的记事本之中换行符和Linux系统之中不一样导致的,解决方案:
    vi编辑器或者vim打开文件,然后在命令模式下输入:

    set ff=unix
    

    然后保存即可
    下面是官网的安装代码,保存到某个.sh文件中,然后执行即可

    # Older versions of Docker were called docker, docker.io, or docker-engine. If these are installed, uninstall them:
    sudo apt-get remove docker docker-engine docker.io containerd runc
    # Update the apt package index and install packages to allow apt to use a repository over HTTPS:
    sudo apt-get update
    
    sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
    # Add Docker’s official GPG key:
    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
    
    sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
    
    # INSTALL DOCKER ENGINE
    # 1.Update the apt package index, and install the latest version of Docker Engine and containerd, or go to the next step to install a specific version:
    sudo apt-get update
    sudo apt-get install docker-ce docker-ce-cli containerd.io
    # 2.To install a specific version of Docker Engine, list the available versions in the repo, then select and install:
    apt-cache madison docker-ce
    # 2.1 List the versions available in your repo:
    read -p "Please input a docker-ce version:" VERSION_STRING
    # 2.2 Install a specific version using the version string from the second column, for example, 5:18.09.1~3-0~ubuntu-xenial.
    sudo apt-get install docker-ce=$VERSION_STRING docker-ce-cli=$VERSION_STRING containerd.io
    # 2.3 Verify that Docker Engine is installed correctly by running the hello-world image.
    sudo docker run hello-world
    

    参考文章

    [1] Install Docker Engine on Ubuntu

  • 相关阅读:
    diy_markdown 的 html 显示
    根据 vuex 的 this.$store.dispatch() 返回值 处理逻辑
    vue 项目配置: 局域网 ip 发布
    vue-markdown 之 markdown-it, 以及 table of content 的实现:markdown-it-toc-and-anchor
    程序员面试金典-面试题 08.05. 递归乘法
    程序员面试金典-面试题 08.04. 幂集
    程序员面试金典-面试题 08.03. 魔术索引
    程序员面试金典-面试题 08.02. 迷路的机器人
    程序员面试金典-面试题 08.01. 三步问题
    程序员面试金典-面试题 05.08. 绘制直线
  • 原文地址:https://www.cnblogs.com/dabenhou/p/13926108.html
Copyright © 2011-2022 走看看