标签:docker inspect json doc container dock connect star nec
docker run -dit --name alpine1 alpine ash
docker run -dit --name alpine2 alpine ash
docker image ls
镜像是一个
docker container ls
运行的容器是两个
docker network inspect bridge
有两个容器连接到这个桥上了
ip addr
有以下三个接口
3: docker0
5: veth73d22a1@if4
7: vethf2cb74e@if6
docker container ls
docker attach alpine1
exit的话,直接就停止容器了,需要用ctrl+p,q
docker attach alpine1
docker attach alpine2
如果停止的话,启动一下就好了
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 alpine2
==================================
第二个指南
docker network create --driver bridge alpine-net
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-net
=====================================
/etc/docker/daemon.json
{
"live-restore": true
}
标签:docker inspect json doc container dock connect star nec
原文地址:https://www.cnblogs.com/createyuan/p/10974042.html