{
 "Docker 網路模型與埠發布#1": {
  "type": "flow",
  "layout": "row",
  "reveal": [
   0,
   2,
   4
  ],
  "nodes": [
   {
    "label": "容器",
    "sub": "獨立網卡與 IP"
   },
   {
    "label": "虛擬網路",
    "sub": "Docker 建立"
   },
   {
    "label": "NAT",
    "sub": "連到外面"
   },
   {
    "label": "外部網路",
    "sub": "需發布埠",
    "kind": "end"
   }
  ]
 },
 "Docker 網路模型與埠發布#2": {
  "type": "cards",
  "reveal": [
   0,
   1,
   2,
   3,
   4
  ],
  "cards": [
   {
    "title": "bridge",
    "points": [
     "預設模式",
     "橋接器互通",
     "對外走 NAT"
    ]
   },
   {
    "title": "host",
    "points": [
     "直接用主機網路",
     "不需要 -p",
     "無網路隔離"
    ]
   },
   {
    "title": "none",
    "points": [
     "只有 loopback",
     "離線運算",
     "高隔離"
    ]
   },
   {
    "title": "進階",
    "points": [
     "overlay 跨主機",
     "macvlan 區網 IP"
    ]
   }
  ]
 },
 "Docker 網路模型與埠發布#3": {
  "type": "table",
  "reveal": [
   0,
   0,
   0,
   1,
   2,
   3
  ],
  "head": [
   "NAME",
   "DRIVER",
   "SCOPE"
  ],
  "rows": [
   [
    "bridge",
    "bridge",
    "local"
   ],
   [
    "host",
    "host",
    "local"
   ],
   [
    "none",
    "null",
    "local"
   ]
  ]
 },
 "Docker 網路模型與埠發布#5": {
  "type": "table",
  "reveal": [
   0,
   1,
   2,
   3
  ],
  "head": [
   "寫法",
   "意思"
  ],
  "rows": [
   [
    "-p 8080:80",
    "所有網卡的 8080 → 容器 80"
   ],
   [
    "-p 127.0.0.1:8080:80",
    "只有主機本機連得到"
   ],
   [
    "-p 192.168.1.10:8080:80",
    "只綁定指定網卡"
   ]
  ]
 },
 "Docker 網路模型與埠發布#6": {
  "type": "table",
  "reveal": [
   0,
   1,
   2,
   3
  ],
  "head": [
   "寫法",
   "意思"
  ],
  "rows": [
   [
    "-p 8080:80/udp",
    "指定 UDP,預設 TCP"
   ],
   [
    "-p 80",
    "主機埠由 Docker 隨機挑"
   ],
   [
    "-P",
    "EXPOSE 的埠對應隨機主機埠"
   ]
  ]
 },
 "自訂網路與容器名稱解析#1": {
  "type": "cards",
  "reveal": [
   0,
   1,
   2
  ],
  "cards": [
   {
    "title": "預設 bridge",
    "points": [
     "只能用 IP 互連",
     "沒有名稱解析",
     "link 已不建議"
    ]
   },
   {
    "title": "自訂 bridge",
    "points": [
     "可用名稱互連",
     "解決 IP 會變動"
    ]
   }
  ]
 },
 "自訂網路與容器名稱解析#2": {
  "type": "cards",
  "reveal": [
   0,
   1,
   2,
   3
  ],
  "cards": [
   {
    "title": "自動 DNS",
    "points": [
     "用容器名稱或別名連線"
    ]
   },
   {
    "title": "隔離更好",
    "points": [
     "同網路才互通"
    ]
   },
   {
    "title": "動態接離",
    "points": [
     "不需重建容器"
    ]
   }
  ]
 },
 "自訂網路與容器名稱解析#3": {
  "type": "table",
  "reveal": [
   0,
   1,
   1,
   2
  ],
  "head": [
   "網路",
   "wget 連 web",
   "結果"
  ],
  "rows": [
   [
    "app-net",
    "用名字 web",
    "成功,不需 -p"
   ],
   [
    "預設 bridge",
    "用名字 web",
    "名稱解析失敗"
   ]
  ]
 },
 "自訂網路與容器名稱解析#4": {
  "type": "flow",
  "layout": "row",
  "reveal": [
   0,
   1,
   2,
   3
  ],
  "nodes": [
   {
    "label": "建立網路",
    "sub": "network create"
   },
   {
    "label": "確認清單",
    "sub": "network ls"
   },
   {
    "label": "查看細節",
    "sub": "network inspect",
    "kind": "end"
   }
  ]
 },
 "自訂網路與容器名稱解析#7": {
  "type": "table",
  "reveal": [
   0,
   0,
   1,
   2,
   3
  ],
  "head": [
   "指令",
   "作用"
  ],
  "rows": [
   [
    "network connect",
    "把執行中容器接上網路"
   ],
   [
    "network disconnect",
    "把容器從網路移除"
   ],
   [
    "network rm",
    "刪除網路,需無容器連著"
   ]
  ]
 },
 "網路除錯與安全設計#1": {
  "type": "flow",
  "layout": "snake",
  "reveal": [
   0,
   1,
   2,
   3,
   4,
   5
  ],
  "nodes": [
   {
    "label": "容器在跑?",
    "sub": "ps / logs"
   },
   {
    "label": "服務在聽?",
    "sub": "0.0.0.0 與埠號"
   },
   {
    "label": "容器之間",
    "sub": "同網路、DNS"
   },
   {
    "label": "主機到容器",
    "sub": "-p、防火牆"
   },
   {
    "label": "外部到主機",
    "sub": "請求有送到",
    "kind": "end"
   }
  ]
 },
 "網路除錯與安全設計#3": {
  "type": "table",
  "reveal": [
   0,
   1,
   2,
   3
  ],
  "head": [
   "目的",
   "指令"
  ],
  "rows": [
   [
    "容器連自己",
    "docker exec web wget"
   ],
   [
    "測試 DNS",
    "nslookup db"
   ],
   [
    "測試連通",
    "ping -c 2 db"
   ]
  ]
 },
 "網路除錯與安全設計#6": {
  "type": "table",
  "reveal": [
   0,
   1,
   3
  ],
  "head": [
   "curl 訊息",
   "常見原因"
  ],
  "rows": [
   [
    "Connection refused",
    "沒服務在聽或沒發布埠"
   ],
   [
    "Connection reset by peer",
    "容器埠寫錯或服務未就緒"
   ],
   [
    "等很久逾時",
    "防火牆或路由問題"
   ]
  ]
 },
 "網路除錯與安全設計#7": {
  "type": "table",
  "reveal": [
   0,
   1,
   2,
   3,
   4
  ],
  "head": [
   "指令",
   "用途"
  ],
  "rows": [
   [
    "docker port",
    "確認埠對應"
   ],
   [
    "curl -v",
    "看連線過程"
   ],
   [
    "ss -lntp | grep 8080",
    "看誰在監聽"
   ],
   [
    "sudo iptables",
    "看 Docker NAT 規則"
   ]
  ]
 }
}