centos 7.6 下安装Docker和启动配置

安装环境

  • Linux 系统内核 3.10 (使用 uname -r查看)
  • curl 文件传输工具 (没有 curl 可使用 yum -y install curl

步骤

  1. 使用curl -sSL https://get.docker.com/ | sh安装docker

  2. 使用docker -v查看docker版本。

  3. 设置国内镜像源。修改 /etc/docker/daemon.json。如果没有这个文件,就创建一个。

    1
    2
    3
    4
    # vi /etc/docker/daemon.json
    {
    "registry-mirrors": ["http://hub-mirror.c.163.com"]
    }
  4. 使用systemctl start docker启动docker

  5. 使用 systemctl enable dockerdocker加入开启启动。

安装 docker-compose

  1. 使用sudo curl -L "https://github.com/docker/compose/releases/download/1.24.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose安装docker-compose
  2. 使用sudo chmod +x /usr/local/bin/docker-compose对二进制文件应用可执行权限。

Docker 学习

作者

zhoulang

发布于

2019-11-12

更新于

2020-12-03

许可协议

You need to set install_url to use ShareThis. Please set it in _config.yml.
You forgot to set the business or currency_code for Paypal. Please set it in _config.yml.

评论

You forgot to set the shortname for Disqus. Please set it in _config.yml.
You need to set client_id and slot_id to show this AD unit. Please set it in _config.yml.