docker/init/1.network.sh

10 lines
334 B
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

source ../environment.sh
if ! docker network inspect ${NETWORK} >/dev/null 2>&1; then
docker network create --driver bridge \
--subnet=172.20.0.0/16 \
--gateway=172.20.0.1 \
${NETWORK}
echo "创建 ${NETWORK} bridge 网络成功,子网: 172.20.0.0/16网关: 172.20.0.1"
else
echo "${NETWORK} 网络已存在"
fi