赞
踩
测试机型x86-64平台
install_docker.sh
- #!/bin/bash
-
- # 设置阿里云的YUM仓库
- cat > /etc/yum.repos.d/docker-ce.repo <<EOF
- [docker-ce-stable]
- name=Docker CE Stable - \$basearch
- baseurl=https://mirrors.aliyun.com/docker-ce/linux/centos/7/\$basearch/stable
- enabled=1
- gpgcheck=1
- gpgkey=https://mirrors.aliyun.com/docker-ce/linux/centos/gpg
- EOF
-
- # 安装所需的包
- yum install -y yum-utils device-mapper-persistent-data lvm2
-
- # 更新YUM缓存
- yum makecache fast
-
- # 安装nano
- yum -y install nano
-
- # 安装Docker CE
- yum install -y docker-ce
-
- # 启用Docker服务
- systemctl enable docker
-
- # 启动Docker服务
- systemctl start docker
-
- echo "Docker has been installed and started!"
-
然后授权执行
- chmod +x install_docker.sh
- sh ./install_docker.sh
nano install_compose_docker.sh
docker-compose文件需要提前下载 放在脚本同目录
docker-compose-linux-x86_64官方版下载丨最新版下载丨绿色版下载丨APP下载-123云盘
- mv docker-compose-linux-x86_64 /usr/local/bin/docker-compose
- sudo chmod +x /usr/local/bin/docker-compose
- sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
- docker --version
- docker-compose --version
授权执行
- chmod +x install_compose_docker.sh
- sh ./install_compose_docker.sh
nano install_gparted.sh
- #!/bin/bash
-
- # 确保系统软件包是最新的
- yum update -y
-
- # 安装 EPEL 仓库,因为 GParted 在默认仓库中不可用
- yum install -y epel-release
-
- # 安装 GParted
- yum install -y gparted
-
- # 运行 GParted
- gparted
授权运行
- chmod +x install_gparted.sh
- sh install_gparted.sh
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。