echo "安装docker环境..." curl -sSL https://get.daocloud.io/docker | sh echo "安装docker环境...安装完成!" # 创建公用网络==bridge模式 #docker network create share_network

编写标准的bash shell脚本:

#!/bin/bash
#file:docker_install.sh
function docker_install()
	echo "检查Docker......"
	docker -v
    if [ $? -eq  0 ]; then
        echo "检查到Docker已安装!"
    	echo "安装docker环境..."
        curl -sSL https://get.daocloud.io/docker | sh
        echo "安装docker环境...安装完成!"
    # 创建公用网络==bridge模式
    #docker network create share_network
# 执行函数
docker_install

这样很简单就实现了docker的环境安装。

纸上得来终觉浅,绝知此事要躬行。