DEV Community

Daniel Pepuho
Daniel Pepuho

Posted on • Updated on

How to create and remove network on Docker

Now i will show you how to create and remove network on Docker, lets follow the instructions :)

create

first, lets see the list of network

docker network ls
Enter fullscreen mode Exit fullscreen mode

then create new network by type this command with name 'demo'

docker network create --subnet=172.16.0.0/24 --gateway=172.16.0.1 demo
Enter fullscreen mode Exit fullscreen mode

at the end, to see the details of 'demo', you can type

docker network inspect demo
Enter fullscreen mode Exit fullscreen mode

remove

to remove network on Dokcer, you can type this

docker network rm demo
Enter fullscreen mode Exit fullscreen mode

N/B : ip address and name of network can custom by you

Discussion (0)