Centos7及Ubuntu系统安装指定版本docker&docker-compose安装
发布于:2023-12-06 16:28:33
标签:/
docker
/
访问:
Centos7系统 docker指定版本安装【官方文档步骤】
官方文档地址:https://docs.docker.com/engine/install/centos/
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
| sudo yum install -y yum-utils
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
sudo yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
yum list docker-ce --showduplicates | sort -r
[root@localhost ~] Repository epel is listed more than once in the configuration Loading mirror speeds from cached hostfile Loaded plugins: fastestmirror, langpacks Installed Packages docker-ce.x86_64 3:24.0.6-1.el7 docker-ce-stable docker-ce.x86_64 3:24.0.6-1.el7 @docker-ce-stable docker-ce.x86_64 3:24.0.5-1.el7 docker-ce-stable docker-ce.x86_64 3:24.0.4-1.el7 docker-ce-stable docker-ce.x86_64 3:24.0.3-1.el7 docker-ce-stable docker-ce.x86_64 3:24.0.2-1.el7 docker-ce-stable docker-ce.x86_64 3:24.0.1-1.el7 docker-ce-stable docker-ce.x86_64 3:24.0.0-1.el7 docker-ce-stable docker-ce.x86_64 3:23.0.6-1.el7 docker-ce-stable docker-ce.x86_64 3:23.0.5-1.el7 docker-ce-stable docker-ce.x86_64 3:23.0.4-1.el7 docker-ce-stable
yum install docker-ce-24.0.6 -y
systemctl enable docker systemctl start docker
|
Ubuntu20.04系统 docker指定版本安装
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
| sudo apt-get remove docker docker-engine docker.io containerd runc
sudo apt-get update
sudo apt-get install\ apt-transport-https \ ca-certificates \ curl \ gnupg-agent \ software-properties-common
curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository \ "deb [arch=amd64] https://mirrors.aliyun.com/docker-ce/linux/ubuntu/ \ $(lsb_release -cs) \ stable"
sudo apt-cache madison docker-ce
dev@localhost:~$ sudo apt-cache madison docker-ce docker-ce | 5:24.0.7-1~ubuntu.20.04~focal | https://mirrors.aliyun.com/docker-ce/linux/ubuntu focal/stable amd64 Packages docker-ce | 5:24.0.6-1~ubuntu.20.04~focal | https://mirrors.aliyun.com/docker-ce/linux/ubuntu focal/stable amd64 Packages docker-ce | 5:24.0.5-1~ubuntu.20.04~focal | https://mirrors.aliyun.com/docker-ce/linux/ubuntu focal/stable amd64 Packages docker-ce | 5:24.0.4-1~ubuntu.20.04~focal | https://mirrors.aliyun.com/docker-ce/linux/ubuntu focal/stable amd64 Packages docker-ce | 5:24.0.3-1~ubuntu.20.04~focal | https://mirrors.aliyun.com/docker-ce/linux/ubuntu focal/stable amd64 Packages docker-ce | 5:24.0.2-1~ubuntu.20.04~focal | https://mirrors.aliyun.com/docker-ce/linux/ubuntu focal/stable amd64 Packages docker-ce | 5:24.0.1-1~ubuntu.20.04~focal | https://mirrors.aliyun.com/docker-ce/linux/ubuntu focal/stable amd64 Packages docker-ce | 5:24.0.0-1~ubuntu.20.04~focal | https://mirrors.aliyun.com/docker-ce/linux/ubuntu focal/stable amd64 Packages docker-ce | 5:23.0.6-1~ubuntu.20.04~focal | https://mirrors.aliyun.com/docker-ce/linux/ubuntu focal/stable amd64 Packages docker-ce | 5:23.0.5-1~ubuntu.20.04~focal | https://mirrors.aliyun.com/docker-ce/linux/ubuntu focal/stable amd64 Packages docker-ce | 5:23.0.4-1~ubuntu.20.04~focal | https://mirrors.aliyun.com/docker-ce/linux/ubuntu focal/stable amd64 Packages docker-ce | 5:23.0.3-1~ubuntu.20.04~focal | https://mirrors.aliyun.com/docker-ce/linux/ubuntu focal/stable amd64 Packages docker-ce | 5:23.0.2-1~ubuntu.20.04~focal | https://mirrors.aliyun.com/docker-ce/linux/ubuntu focal/stable amd64 Packages docker-ce | 5:23.0.1-1~ubuntu.20.04~focal | https://mirrors.aliyun.com/docker-ce/linux/ubuntu focal/stable amd64 Packages docker-ce | 5:23.0.0-1~ubuntu.20.04~focal | https://mirrors.aliyun.com/docker-ce/linux/ubuntu focal/stable amd64 Packages docker-ce | 5:20.10.24~3-0~ubuntu-focal | https://mirrors.aliyun.com/docker-ce/linux/ubuntu focal/stable amd64 Packages docker-ce | 5:20.10.23~3-0~ubuntu-focal | https://mirrors.aliyun.com/docker-ce/linux/ubuntu focal/stable amd64 Packages docker-ce | 5:20.10.22~3-0~ubuntu-focal | https://mirrors.aliyun.com/docker-ce/linux/ubuntu focal/stable amd64 Packages docker-ce | 5:20.10.21~3-0~ubuntu-focal | https://mirrors.aliyun.com/docker-ce/linux/ubuntu focal/stable amd64 Packages docker-ce | 5:20.10.20~3-0~ubuntu-focal | https://mirrors.aliyun.com/docker-ce/linux/ubuntu focal/stable amd64 Packages docker-ce | 5:20.10.19~3-0~ubuntu-focal | https://mirrors.aliyun.com/docker-ce/linux/ubuntu focal/stable amd64 Packages docker-ce | 5:20.10.18~3-0~ubuntu-focal | https://mirrors.aliyun.com/docker-ce/linux/ubuntu focal/stable amd64 Packages
sudo apt-get install docker-ce=5:20.10.22~3-0~ubuntu-focal docker-ce-cli=5:20.10.22~3-0~ubuntu-focal containerd.io
sudo usermod -aG docker dev
|
docker-compose安装
1 2 3 4 5 6 7 8
| #!/bin/bash
sudo curl -L https://github.com/docker/compose/releases/download/1.18.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
chmod u+x /usr/local/bin/docker-compose
docker-compose --version
|