Docker: Difference between revisions
Jump to navigation
Jump to search
Line 23: | Line 23: | ||
docker network ls | docker network ls | ||
docker network prune | docker network prune | ||
docker network rm | docker network rm cki_nt00 cki_nt01 | ||
docker inspect nginx|grep "IPAddress" | |||
docker network inspect bridge|grep "Gateway" | |||
</source> | </source> | ||
<source lang="bash"> | <source lang="bash"> | ||
docker network create --subnet 10.19.83.0/24 --ip-range 10.19.83.16/28 | docker network create \ | ||
docker network create --subnet 10.19.83.0/24 --ip-range 10.19.83.32/28 | --driver bridge \ | ||
docker network create --subnet 10.19.83.0/24 --ip-range 10.19.83.48/28 | --subnet 10.19.83.0/24 \ | ||
docker network create --subnet 10.19.83.0/24 --ip-range 10.19.83.64/28 | --ip-range 10.19.83.16/28 \ | ||
docker network create --subnet 10.19.83.0/24 --ip-range 10.19.83.80/28 | --opt com.docker.network.bridge.name=cki_br01 cki_br01 | ||
docker network create --subnet 10.19.83.0/24 --ip-range 10.19.83.32/28 cki_br02 | |||
docker network create --subnet 10.19.83.0/24 --ip-range 10.19.83.48/28 cki_br03 | |||
docker network create --subnet 10.19.83.0/24 --ip-range 10.19.83.64/28 cki_br04 | |||
docker network create --subnet 10.19.83.0/24 --ip-range 10.19.83.80/28 cki_br05 | |||
</source> | </source> | ||
<source lang="bash"> | <source lang="bash"> | ||
docker network create --subnet 10.20.13.0/24 --ip-range 10.20.13.16/28 | docker network create --subnet 10.20.13.0/24 --ip-range 10.20.13.16/28 cki_nt01 | ||
docker network create --subnet 10.20.13.0/24 --ip-range 10.20.13.32/28 | docker network create --subnet 10.20.13.0/24 --ip-range 10.20.13.32/28 cki_nt02 | ||
docker network create --subnet 10.20.13.0/24 --ip-range 10.20.13.48/28 | docker network create --subnet 10.20.13.0/24 --ip-range 10.20.13.48/28 cki_nt03 | ||
docker network create --subnet 10.20.13.0/24 --ip-range 10.20.13.64/28 | docker network create --subnet 10.20.13.0/24 --ip-range 10.20.13.64/28 cki_nt04 | ||
docker network create --subnet 10.20.13.0/24 --ip-range 10.20.13.80/28 | docker network create --subnet 10.20.13.0/24 --ip-range 10.20.13.80/28 cki_nt05 | ||
</source> | </source> | ||
<source lang="bash"> | <source lang="bash"> | ||
docker run -itd --network= | docker run -itd --network=cki_nt01 nginx | ||
docker network disconnect | docker network disconnect cki_nt01 nginx | ||
docker network connect --alias db --alias mysql | docker network connect --alias db --alias mysql cki_nt01 mysql | ||
</source> | </source> | ||
Revision as of 02:37, 14 September 2020
Windows 10 Home
# powershell
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
wsl --set-default-version 2
# powershell
docker pull hello-world
docker run -it --rm --name hello hello-world:latest
# gitbash
winpty docker pull hello-world
winpty docker run -it --rm --name hello hello-world:latest
Knowledge
docker network ls
docker network prune
docker network rm cki_nt00 cki_nt01
docker inspect nginx|grep "IPAddress"
docker network inspect bridge|grep "Gateway"
docker network create \
--driver bridge \
--subnet 10.19.83.0/24 \
--ip-range 10.19.83.16/28 \
--opt com.docker.network.bridge.name=cki_br01 cki_br01
docker network create --subnet 10.19.83.0/24 --ip-range 10.19.83.32/28 cki_br02
docker network create --subnet 10.19.83.0/24 --ip-range 10.19.83.48/28 cki_br03
docker network create --subnet 10.19.83.0/24 --ip-range 10.19.83.64/28 cki_br04
docker network create --subnet 10.19.83.0/24 --ip-range 10.19.83.80/28 cki_br05
docker network create --subnet 10.20.13.0/24 --ip-range 10.20.13.16/28 cki_nt01
docker network create --subnet 10.20.13.0/24 --ip-range 10.20.13.32/28 cki_nt02
docker network create --subnet 10.20.13.0/24 --ip-range 10.20.13.48/28 cki_nt03
docker network create --subnet 10.20.13.0/24 --ip-range 10.20.13.64/28 cki_nt04
docker network create --subnet 10.20.13.0/24 --ip-range 10.20.13.80/28 cki_nt05
docker run -itd --network=cki_nt01 nginx
docker network disconnect cki_nt01 nginx
docker network connect --alias db --alias mysql cki_nt01 mysql