docker学习笔记001-docker 安装方法介绍-阿里云开发者社区

开发者社区> 开发与运维> 正文
登录阅读全文

docker学习笔记001-docker 安装方法介绍

简介: docker安装笔记001-

docker Setup

docker推荐使用version 1.13或者更高版本

docker 包含社区版和企业版 Community Edition (CE) and Enterprise Edition (EE).

支持多种平台

DeskTop:Mac、Windows

Cloud:Amazon 、Microsoft

Server:CentOs、OracleLinux、Ubuntu、Debian、Red Hat Enterprise Linux


安装docker CE

启动一个docker CE,需要确认前置要求,再执行安装操作。EE版本是收费版本不做介绍

前置要求

OS要求、老版本要求:docker docker-engine查看

安装

 1.Docker’s repositories安装

  1. Install required packages. yum-utils provides the yum-config-manager utility, and device-mapper-persistent-data and lvm2 are required by the devicemapper storage driver.

    $ sudo yum install -y yum-utils \
      device-mapper-persistent-data \
      lvm2
    
  2. Use the following command to set up the stable repository. You always need the stable repository, even if you want to install builds from the edge or test repositories as well.

    $ sudo yum-config-manager \
        --add-repo \
        https://download.docker.com/linux/centos/docker-ce.repo
    
  3. Optional: Enable the edge and test repositories. These repositories are included in the docker.repo file above but are disabled by default. You can enable them alongside the stable repository.

    $ sudo yum-config-manager --enable docker-ce-edge
    
    $ sudo yum-config-manager --enable docker-ce-test
    

    You can disable the edge or test repository by running the yum-config-manager command with the --disableflag. To re-enable it, use the --enable flag. The following command disables the edge repository.

    $ sudo yum-config-manager --disable docker-ce-edge



Install the latest version of Docker CE, or go to the next step to install a specific version.

$ sudo yum install docker-ce
  1. Start Docker.

    $ sudo systemctl start docker
    
  2. Verify that docker is installed correctly by running the hello-world image.

    $ sudo docker run hello-world


2.下载rpm,手动安装


从这下载

https://download.docker.com/linux/centos/7/x86_64/stable/Packages/ 

Install Docker CE, changing the path below to the path where you downloaded the Docker package.

$ sudo yum install /path/to/package.rpm

3.scripts脚本自动安装


4.卸载

  1. Uninstall the Docker package:

    $ sudo yum remove docker-ce
    
  2. 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
    

You must delete any edited configuration files manually.













版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。

分享:
开发与运维
使用钉钉扫一扫加入圈子
+ 订阅

集结各类场景实战经验,助你开发运维畅行无忧

其他文章