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

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.













上一篇:DQL(数据查询语言)之模糊查询 | 学习笔记


下一篇:快速入门vue3.0系列之生命周期及父传值,建议“收藏细品”,会持续更新!❤