6

閱讀筆記: 「如何於 Docker 環境中運行 rootless 模式」

 2 years ago
source link: https://www.hwchiu.com/read-notes-33.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

閱讀筆記: 「如何於 Docker 環境中運行 rootless 模式」

Posted on 2022-03-28

Views: 18

「如何於 Docker 環境中運行 rootless 模式」

標題: 「如何於 Docker 環境中運行 rootless 模式」
類別: container
連結: https://thenewstack.io/how-to-run-docker-in-rootless-mode/

雖然可以使用非 root 的方式去安裝 Docker 服務,但是 Docker 本身服務中還有其他各種元件需要透過 root 身份去運行,譬如 dockerd, containerd, runc 等元件,
而本篇文章則是探討要如何以真正 rootless 的方式來運行一個 docker container 。

使用 rootless container 有一些要注意的事情,譬如 port number 沒有辦法使用 1024 以下,所以如果你的服務有需要被外界存取時要使用大於 1024 的 port number。
此外 AppArmor, host network mode 這些都不支援,因此使用上會有一些情境要注意。

安裝其實滿簡單的, Docker 官網有提供 rootless 的安裝檔案,安裝後需要針對一個使用者 ID 進行處理,這個處理主要是因為要將 container 內的 root 使用者給轉換到系統上的非 root 使用者,所以才會有相關的 userID 要設定。
當然如果真的要完全追求 rootless 的容器解決方案可以考慮使用 Podman 來使用,其本身的設定就是針對 rootless 去開發的,使用上會相對於 docker 來說更為簡單。

我目前於 Hiskio 平台上面有開設 Kubernetes 相關課程,歡迎有興趣的人參考並分享,裡面有我從底層到實戰中對於 Kubernetes 的各種想法

詳細可以參閱
線上課程詳細資訊: https://course.hwchiu.com/

另外,歡迎按讚加入我個人的粉絲專頁,裡面會定期分享各式各樣的文章,有的是翻譯文章,也有部分是原創文章,主要會聚焦於 CNCF 領域
https://www.facebook.com/technologynoteniu

如果有使用 Telegram 的也可以訂閱下列頻道來,裡面我會定期推播通知各類文章
https://t.me/technologynote

你的捐款將給予我文章成長的動力

Related Posts

Welcome to my other publishing channels


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK