docker 網絡

 

 

docker run -dit --name alpine1 alpine ash
docker run -dit --name alpine2 alpine ash
docker image ls
鏡像是一個
docker container ls
運行的容器是兩個docker

docker network inspect bridge
有兩個容器鏈接到這個橋上了json

ip addr
有如下三個接口
3: docker0
5: veth73d22a1@if4
7: vethf2cb74e@if63d


docker container ls
docker attach alpine1
exit的話,直接就中止容器了,須要用ctrl+p,q
docker attach alpine1
docker attach alpine2rest

若是中止的話,啓動一下就行了
docker container ls -a
docker container start b12921b401ce 75cfe177ceba
docker container start b12921b401ce
dcoker container ls接口

docker container stop alpine1 alpine2
docker container rm alpine1 alpine2ip


==================================
第二個指南
docker network create --driver bridge alpine-netit


docker run -dit --name alpine1 --network alpine-net alpine ash
docker run -dit --name alpine2 --network alpine-net alpine ash
docker run -dit --name alpine3 alpine ash
docker run -dit --name alpine4 --network alpine-net alpine ash
docker network connect bridge alpine4
dcoker container ls容器

docker network inspect bridge
docker network inspect alpine-netnetwork

 


=====================================im


/etc/docker/daemon.json

{ "live-restore": true}

相關文章
相關標籤/搜索