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}