technology-note/linux/docker/1.linux下docker安装与配置.md
fanxb d8f3281cea Revert "删除历史已被发布数据"
This reverts commit 4d564918e11d3b7d5cf31ae6aee3befe2f559b62.
2019-04-16 09:56:12 +08:00

1.4 KiB
Raw Blame History

id date title tags categories
2018-11-20-10-38-05 2018/11/20 10:38:05 1.linux下mongodb的配置与安装
docker
linux
ubuntu
linux
docker教程

一、安装

有两种安装方法脚本安装和apt安装

1、脚本安装

root下执行以下命令(非root下会要求输入密码

wget -qO- https://get.docker.com/ | sh

等待执行完毕后会有如下提示:

    If you would like to use Docker as a non-root user, you should now consider
    adding your user to the "docker" group with something like:

    sudo usermod -aG docker 用户名
   Remember that you will have to log out and back in for this to take effect! 

就是如果要以非root用户直接运行docker时需要执行sudo usermod -aG docker 非root用户名,然后重新登陆即可。

2、apt安装

  直接运行(root下)

apt-get update
apt-get install docker.io

二、配置国内源

  国外源太慢配置为国内源。修改或创建/etc/docker/daemon.json,内容如下:

{
    "registry-mirrors": [
        "加速地址"
    ],
    "insecure-registries": []
}

以下是国内加速地址: