docker exec -it n1 bash apt-get update apt-get install keepalived apt-get install vim 再次以前要配置VIP虛擬IP docker network create --subnet=192.168.99.151/16 net1 docker network ls 這裏還要設置下vim 沒法粘貼問題 vi /etc/keepalived/keepalived.conf 啓動keepalived service keepalived start docker run -it -d --name n2 -v /home/n2/nginx.conf:/etc/nginx/nginx.conf --net=host --privileged nginx 重複上面步驟