Docker 笔记

Summary: Author: 张亚飞 | 阅读时间: 1 minute read | Published: 2018-10-17
Filed under Categories: MarkDownTags: Tag,

Docker 笔记

Docker Machine 笔记


安装 Docker

apt install -y apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
apt-key fingerprint 0EBFCD88
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
apt update
apt install -y docker-ce
docker version
docker info
#docker login

安装 docker-compose

sudo curl -L "https://github.com/docker/compose/releases/download/1.23.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose

升级 Docker

重新执行一遍安装步骤.


常见错误

  • 执行 docker info 提示如下警告:
WARNING: bridge-nf-call-iptables is disabled
WARNING: bridge-nf-call-ip6tables is disabled

解决办法:修改 /etc/sysctl.conf 添加以下内容

net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1

最后再执行

sysctl -p

常见问题

  • 使用 docker 启动报以下错误
$ docker-compose up us.gitlab
ERROR: Pool overlaps with other one on this address space

重启服务器及 docker 服务均无效,最终使用以下命令解决:

docker network prune

Comments

  • says: 2019-09-23 21:16:04

    Hello,My name is Cor Ethan...

Cor-Ethan, the beverage → www.iirii.com