一. 编写脚本
sudo cat << EOF > ./docker_docker-compose_install.sh
#!/bin/sh
# -*- coding: utf-8 -*-
apt install -y firewalld apt-transport-https ca-certificates curl software-properties-common gcc
apt -y install docker.io
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config && setenforce 0
apt -y install docker-compose
systemctl enable --now docker.service
EOF
二. 运行脚本
sudo sh ./docker_docker-compose_install.sh && rm -rf ./docker_docker-compose_install.sh
网友评论