#!/bin/bash
#opencloudOs上面安装docker docker-compose环境
curl -o /etc/yum.repos.d/docker-ce.repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
sed -i s/\$releasever/8/g /etc/yum.repos.d/docker-ce.repo
wget https://vault.centos.org/centos/8/AppStream/x86_64/os/Packages/container-selinux-2.124.0-1.gitf958d0c.module_el8.3.0+569+1bada2e4.noarch.rpm
rpm -ivh container-selinux-2.124.0-1.gitf958d0c.module_el8.3.0+569+1bada2e4.noarch.rpm
dnf install docker-ce-20.10.7 docker-ce-cli-20.10.7 -y
systemctl start docker
systemctl enable docker
#1、在线下载比较慢,也可以直接上传文件到/usr/local/bin/,然后添加文件执行权限
#curl -L "https://github.com/docker/compose/releases/download/v2.23.3/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
#chmod +x /usr/local/bin/docker-compose
#1、在线下载比较慢,也可以直接上传文件到/usr/local/bin/,然后添加文件执行权限
#curl -L “https://github.com/docker/compose/releases/download/v2.23.3/docker-compose-
(
u
n
a
m
e
?
s
)
?
(uname -s)-
(uname?s)?(uname -m)” -o /usr/local/bin/docker-compose
#chmod +x /usr/local/bin/docker-compose