Docker: Difference between revisions

From Chorke Wiki
Jump to navigation Jump to search
Line 24: Line 24:
docker network prune
docker network prune
docker network rm my_docker_net_00 my_docker_net_01
docker network rm my_docker_net_00 my_docker_net_01
</source>


docker run -itd --network=my_docker_net_00 nexus
<source lang="bash">
docker network connect --alias db --alias mysql my_docker_net_00 mysql
docker network create --subnet 10.19.83.0/24  --ip-range 10.19.83.16/28 my_docker_brg_01
docker network create --subnet 10.20.13.10/24 --ip-range 10.20.13.80/28 my_docker_net_00
docker network create --subnet 10.19.83.0/24  --ip-range 10.19.83.32/28 my_docker_brg_02
docker network create --subnet 10.19.83.0/24  --ip-range 10.19.83.48/28 my_docker_brg_03
docker network create --subnet 10.19.83.0/24  --ip-range 10.19.83.64/28 my_docker_brg_04
docker network create --subnet 10.19.83.0/24  --ip-range 10.19.83.80/28 my_docker_brg_05
</source>
 
<source lang="bash">
docker network create --subnet 10.20.13.10/24 --ip-range 10.19.83.16/28 my_docker_net_01
docker network create --subnet 10.20.13.10/24 --ip-range 10.19.83.32/28 my_docker_net_02
docker network create --subnet 10.20.13.10/24 --ip-range 10.19.83.48/28 my_docker_net_03
docker network create --subnet 10.20.13.10/24 --ip-range 10.19.83.64/28 my_docker_net_04
docker network create --subnet 10.20.13.10/24 --ip-range 10.20.13.80/28 my_docker_net_05
</source>
 
<source lang="bash">
docker run -itd --network=my_docker_net_01 nexus
docker network disconnect my_docker_net_01 nexus
docker network connect --alias db --alias mysql my_docker_net_01 mysql
</source>
</source>



Revision as of 18:00, 26 August 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 my_docker_net_00 my_docker_net_01
docker network create --subnet 10.19.83.0/24  --ip-range 10.19.83.16/28 my_docker_brg_01
docker network create --subnet 10.19.83.0/24  --ip-range 10.19.83.32/28 my_docker_brg_02
docker network create --subnet 10.19.83.0/24  --ip-range 10.19.83.48/28 my_docker_brg_03
docker network create --subnet 10.19.83.0/24  --ip-range 10.19.83.64/28 my_docker_brg_04
docker network create --subnet 10.19.83.0/24  --ip-range 10.19.83.80/28 my_docker_brg_05
docker network create --subnet 10.20.13.10/24 --ip-range 10.19.83.16/28 my_docker_net_01
docker network create --subnet 10.20.13.10/24 --ip-range 10.19.83.32/28 my_docker_net_02
docker network create --subnet 10.20.13.10/24 --ip-range 10.19.83.48/28 my_docker_net_03
docker network create --subnet 10.20.13.10/24 --ip-range 10.19.83.64/28 my_docker_net_04
docker network create --subnet 10.20.13.10/24 --ip-range 10.20.13.80/28 my_docker_net_05
docker run -itd --network=my_docker_net_01 nexus
docker network disconnect my_docker_net_01 nexus
docker network connect --alias db --alias mysql my_docker_net_01 mysql

Reference