Docker入門教程(八)Docker Remote API
在 Docker教程系列的上一章中,我們討論Docker Hub 以及 Docker Registry API。在今天的文章里,讓我們深入探討Docker Remote API。
Docker Remote API
Docker Remote API是取代rcli(遠程命令行界面)的REST API。對于本教程的目的,我們使用一個命令行工具cURL來處理url操作。它有助于發出請求、獲取與發送數據并且檢索信息。List containers
獲取所有容器的清單:GET /containers/json

Create a new container
創建新的容器:POST /containers/create

Inspect Container
使用容器id獲取該容器底層信息:GET /containers/(id)/json

Process List
獲取容器內進程的清單:GET /containers/(id)/top

Container Logs
獲取容器的標準輸出和錯誤日志:GET /containers/(id)/logs

Export Container
導出容器內容:GET /containers/(id)/export

Start a container
開啟容器:POST /containers/(id)/start

Stop a container
停止容器:POST /containers/(id)/stop

Restart a Container
重啟容器:POST /containers/(id)/restart

Kill a container
終止容器:POST /containers/(id)/kill

現在,我們已經帶您領略了Docker API的第二站, Docker教程系列下一章會了解有關鏡像的Docker Remote API命令。我們所有的Docker教程系列你可以在 這里找到。
本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!