#!/bin/bash # for i in 192.168.188.{1..254};do ping -c 2 -i 0.1 -W 1 $i &> /dev/null if [ $? = 0 ];then echo "$i IP is up" &> /dev/null else echo "$i IP is down" fi done read -p "請輸入您選著的(IP/子網(wǎng)@網(wǎng)關)即將付給一下的docker容器: " IP read -p "請輸入您想要制作的容器(注意該容器基于debian06-base創(chuàng)建: )" NAME read -p "請輸入您想映射的本機端口號: " DK read -p "請輸入您想映射的容器端口: " DK2 read -p "請輸入本地數(shù)據(jù)的掛載位置: " WZ read -p "請輸入docker容器的數(shù)據(jù)掛載位置: " WZ2 docker -p $DK:$DK --name $NAME -h $NAME -net none -v $WZ:$WZ2 -it debian06-base if [ $? = 0 ];then echo "docker 容器:$NAME 已經(jīng)創(chuàng)建完成且以開啟" sleep 3 pipework lo:1 $NAME $IP docker exec $NAME ifconfig else echo "請檢查本腳本docker創(chuàng)建命令" fi |
|
來自: 昵稱27276047 > 《待分類1》