首页 > 其他分享 >docker install

docker install

时间:2022-11-30 18:48:17浏览次数:47  
标签:bridge ce yum install docker Docker

环境准备

centos7 

Uninstall old versions

yum remove docker \
                  docker-client \
                  docker-client-latest \
                  docker-common \
                  docker-latest \
                  docker-latest-logrotate \
                  docker-logrotate \
                  docker-engine

Install using the repository

yum install -y yum-utils epel-release device-mapper-persistent-data lvm2

yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

Install Docker Engine

# Install the latest version of Docker Engine and containerd,
yum install -y docker-ce docker-ce-cli containerd.io

# To install a specific version of Docker Engine
yum list docker-ce --showduplicates | sort -r
yum install docker-ce-<VERSION_STRING> docker-ce-cli-<VERSION_STRING> containerd.io

配置 Docker 守护程序,尤其是使用 systemd 来管理容器的cgroup

sudo mkdir /etc/docker
cat <<EOF | sudo tee /etc/docker/daemon.json
{
  "exec-opts": ["native.cgroupdriver=systemd"],
  "log-driver": "json-file",
  "log-opts": {
    "max-size": "100m"
  },
  "storage-driver": "overlay2"
}
EOF

重新启动 Docker 并在启动时启用

sudo systemctl enable docker
sudo systemctl daemon-reload
sudo systemctl restart docker

Verify that Docker Engine is installed correctly by running the hello-world image

docker run hello-world

Uninstall Docker Engine

yum remove docker-ce docker-ce-cli containerd.io
rm -rf /var/lib/docker
rm -rf /var/lib/containerd

故障处理

WARNING: bridge-nf-call-iptables is disabled

docker info 时候 会提示

WARNING: bridge-nf-call-iptables is disabled
WARNING: bridge-nf-call-ip6tables is disabled
vi /etc/sysctl.conf

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

sysctl -p 

标签:bridge,ce,yum,install,docker,Docker
From: https://www.cnblogs.com/wl30564/p/16939360.html

相关文章

  • docker仓库登录 配置insecure-registries
    错误现象Errorresponsefromdaemon:Gethttps://******:5000/v2/:http:servergaveHTTPresponsetoHTTPSclientDocker客户端配置-一种方式即可配置完记得重......
  • docker配置jenkins环境搭建
    开始安装1.启动docker,下载Jenkins镜像文件dockerpulljenkins/jenkins    2.创建Jenkins挂载目录并授权权限(我们在服务器上先创建一个jenkins工作目录/var/......
  • Docker 网络详解
    这一篇文章将介绍Docker中的网络情况,欢迎大家学习讨论。docker网络官网https://docs.docker.com/network/计算机网络模型OSI七层模型TCP/IP四层模型Linux中网卡查看网卡[网......
  • 深入理解Docker中Container
    Container与Image的关系既然container是由image运行起来的,那么是否可以理解为container和image有某种关系?其实可以理解为container只是基于image之后的layer而已,也就是可以......
  • Docker的深入理解
    深入探讨Image 说白了,image就是由一层一层的layer组成的。官方image​​https://github.com/docker-library​​例如tomcat的地址​​https://github.com/docker-library/t......
  • 【Docker】清理磁盘占用
    查看磁盘空间占用#/var/lib/docker#du-sh*发现overlay2目录占用空间特别大深入查看发现是Logs占用空间转移备份并删除即可......
  • 【Docker】基本使用
    服务启动dockersystemctlstartdocker重启dockersystemctlrestartdocker停止dockersystemctlstopdocker.sockesystemctlstopdocker如果linux重启......
  • 关于docker技术的学习
    一、docker的介绍1、什么是dockerDocker是一种轻量虚拟化的容器技术,提供类似虚拟机的隔离功能。Docker容器将软件以及它运行安装所需的一切文件(代码、运行时、系统......
  • How to Install Python on Linux
    SummaryHostmonsterusesthepreinstalledversionofPythonthatshipswithCentOS.Becauseofthisitisoftennotthelatestrelease.Thisarticlewillexplain......
  • docker中安装db2
    1.查看可安装的db2版本dockersearchdb2express-c2.下载db2镜像dockerpullibmoms/db2express-c 3.安装镜像dockerrun-it --namedb2-p50000:50000-eDB2IN......