Centos 7 X64安装docker和docker composer
-
1. 安装docker
先安装依赖
$ yum install -y yum-utils \ device-mapper-persistent-data \ lvm2 $ yum-config-manager \ --add-repo \ https://download.docker.com/linux/centos/docker-ce.repo yum list docker-ce --showduplicates | sort -r 已加载插件:fastestmirror, langpacks 可安装的软件包 * updates: mirrors.aliyun.com Loading mirror speeds from cached hostfile * extras: mirrors.aliyun.com docker-ce.x86_64 3:19.03.2-3.el7 docker-ce-stable docker-ce.x86_64 3:19.03.1-3.el7 docker-ce-stable docker-ce.x86_64 3:19.03.0-3.el7 docker-ce-stable docker-ce.x86_64 3:18.09.9-3.el7 docker-ce-stable ...
选择安装一个版本
yum install docker-ce-20.10.18-3.el7 -y
启动 Docker
systemctl start docker systemctl enable docker
配置 Docker阿里云 镜像加速器
cat <<EOF> /etc/docker/daemon.json { "exec-opts": ["native.cgroupdriver=systemd"], "registry-mirrors": ["https://x83mabsk.mirror.aliyuncs.com"] } EOF # 生效 systemctl daemon-reload systemctl restart docker
测试是否安装成功
[root@localhost ~]# docker version Client: Docker Engine - Community Version: 20.10.18 API version: 1.41 Go version: go1.18.6 Git commit: b40c2f6 Built: Thu Sep 8 23:14:08 2022 OS/Arch: linux/amd64 Context: default Experimental: true Server: Docker Engine - Community Engine: Version: 20.10.18 API version: 1.41 (minimum version 1.12) Go version: go1.18.6 Git commit: e42327a Built: Thu Sep 8 23:12:21 2022 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.6.8 GitCommit: 9cd3357b7fd7218e4aec3eae239db1f68a5a6ec6 runc: Version: 1.1.4 GitCommit: v1.1.4-0-g5fd4c4d docker-init: Version: 0.19.0 GitCommit: de40ad0
2. 安装docker-compose
curl -L "https://github.com/docker/compose/releases/download/v2.10.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
推荐阅读
文章标签:
版权声明: 本文除特别说明外均由 麒麟在线 原创
本文链接: https://www.70ol.com/jishu/63.html,尊重共享,欢迎转载,请自觉添加本文链接,谢谢!
分享本文: 请填写您的分享代码。
呃 本文暂时没人评论 来添加一个吧
发表评论