Docker 簡要概述(譯)

Docker Architecture Diagram

官方網(wǎng)站: https://docs.docker.com/get-started/overview/

The Docker daemon

Docker daemon (dockerd) 監(jiān)聽 Docker API 請求并管理 Docker 對象,例如鏡像、容器绕娘、網(wǎng)絡(luò)和卷缴啡。 守護(hù)進(jìn)程還可以與其他守護(hù)進(jìn)程通信以管理 Docker 服務(wù)。
The Docker daemon (dockerd) listens for Docker API requests and manages Docker objects such as images, containers, networks, and volumes. A daemon can also communicate with other daemons to manage Docker services.

The Docker client

Docker 客戶端 (docker) 是許多 Docker 用戶與 Docker 交互的主要方式撵溃。 當(dāng)您使用諸如 docker run 之類的命令時(shí),客戶端會將這些命令發(fā)送到 dockerd,后者會執(zhí)行這些命令梧却。 docker 命令使用 Docker API。 Docker 客戶端可以與多個(gè)守護(hù)進(jìn)程通信桃煎。
The Docker client (docker) is the primary way that many Docker users interact with Docker. When you use commands such as docker run, the client sends these commands to dockerd, which carries them out. The docker command uses the Docker API. The Docker client can communicate with more than one daemon.

Docker registries

Docker registry存儲 Docker 鏡像篮幢。 Docker Hub 是一個(gè)任何人都可以使用的公共注冊中心,Docker 默認(rèn)配置為在 Docker Hub 上查找鏡像为迈。 您也可以運(yùn)行自己的私有注冊表三椿。當(dāng)您使用 docker pull 或 docker run 命令時(shí),所需的圖像將從您配置的Docker registry中提取葫辐。 當(dāng)您使用 docker push 命令時(shí)搜锰,您的圖像將被推送到您配置的Docker registry。
A Docker registry stores Docker images. Docker Hub is a public registry that anyone can use, and Docker is configured to look for images on Docker Hub by default. You can even run your own private registry. When you use the docker pull or docker run commands, the required images are pulled from your configured registry. When you use the docker push command, your image is pushed to your configured registry.

Docker objects

使用 Docker 時(shí)耿战,您是在創(chuàng)建和使用鏡像、容器狈涮、網(wǎng)絡(luò)歌馍、卷、插件和其他對象暴浦。
When you use Docker, you are creating and using images, containers, networks, volumes, plugins, and other objects. This section is a brief overview of some of those objects.

Images

Image是一個(gè)只讀模板歌焦,其中包含創(chuàng)建 Docker 容器的說明独撇。 通常窟社,一個(gè)Image基于另一個(gè)Image灿里,并進(jìn)行了一些額外的自定義。 例如儒拂,您可以構(gòu)建一個(gè)基于 ubuntu Image的Image色鸳,但安裝 Apache 網(wǎng)絡(luò)服務(wù)器和您的應(yīng)用程序命雀,以及使您的應(yīng)用程序運(yùn)行所需的配置詳細(xì)信息。 您可以創(chuàng)建自己的Image吏砂,也可以僅使用其他人創(chuàng)建并在Docker Registry中發(fā)布的映像。 要構(gòu)建您自己的Image淀歇,您可以使用簡單的語法創(chuàng)建一個(gè) Dockerfile匈织,用于定義創(chuàng)建和運(yùn)行Image所需的步驟牡直。 Dockerfile 中的每條指令都會在Image中創(chuàng)建一個(gè)層碰逸。 當(dāng)您更改 Dockerfile 并重建映像時(shí)花竞,只會重建那些已更改的層掸哑。 與其他虛擬化技術(shù)相比苗分,這是使映像如此輕巧摔癣、小巧和快速的部分原因择浊。
An image is a read-only template with instructions for creating a Docker container. Often, an image is based on another image, with some additional customization. For example, you may build an image which is based on the ubuntu image, but installs the Apache web server and your application, as well as the configuration details needed to make your application run. You might create your own images or you might only use those created by others and published in a registry. To build your own image, you create a Dockerfile with a simple syntax for defining the steps needed to create the image and run it. Each instruction in a Dockerfile creates a layer in the image. When you change the Dockerfile and rebuild the image, only those layers which have changed are rebuilt. This is part of what makes images so lightweight, small, and fast, when compared to other virtualization technologies.

Containers

容器是Image的可運(yùn)行實(shí)例琢岩。 您可以使用 Docker API 或 CLI 創(chuàng)建师脂、啟動(dòng)、停止吃警、移動(dòng)或刪除容器糕篇。 您可以將容器連接到一個(gè)或多個(gè)網(wǎng)絡(luò)酌心,為其附加存儲拌消,甚至可以根據(jù)其當(dāng)前狀態(tài)創(chuàng)建新的Image安券。 默認(rèn)情況下墩崩,容器與其他容器及其主機(jī)相對隔離完疫。 您可以控制容器的網(wǎng)絡(luò)泰鸡、存儲或其他底層子系統(tǒng)與其他容器或主機(jī)之間的隔離程度。 容器由其映像以及您在創(chuàng)建或啟動(dòng)它時(shí)提供給它的任何配置選項(xiàng)定義壳鹤。 當(dāng)容器被移除時(shí)盛龄,未存儲在持久存儲中的對其狀態(tài)的任何更改都會消失。
A container is a runnable instance of an image. You can create, start, stop, move, or delete a container using the Docker API or CLI. You can connect a container to one or more networks, attach storage to it, or even create a new image based on its current state. By default, a container is relatively well isolated from other containers and its host machine. You can control how isolated a container’s network, storage, or other underlying subsystems are from other containers or from the host machine. A container is defined by its image as well as any configuration options you provide to it when you create or start it. When a container is removed, any changes to its state that are not stored in persistent storage disappear.

Volumes

卷提供了將容器的特定文件系統(tǒng)路徑連接回主機(jī)的能力余舶。 如果掛載了容器中的目錄,則主機(jī)上也會看到該目錄中的更改赠制。 如果我們在容器重新啟動(dòng)時(shí)掛載相同的目錄挟憔,我們會看到相同的文件政恍。
Volumes provide the ability to connect specific filesystem paths of the container back to the host machine. If a directory in the container is mounted, changes in that directory are also seen on the host machine. If we mount that same directory across container restarts, we’d see the same files.

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末达传,一起剝皮案震驚了整個(gè)濱河市宪赶,隨后出現(xiàn)的幾起案子宗弯,更是在濱河造成了極大的恐慌,老刑警劉巖搂妻,帶你破解...
    沈念sama閱讀 216,919評論 6 502
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件蒙保,死亡現(xiàn)場離奇詭異,居然都是意外死亡叽讳,警方通過查閱死者的電腦和手機(jī)追他,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 92,567評論 3 392
  • 文/潘曉璐 我一進(jìn)店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來岛蚤,“玉大人邑狸,你說我怎么就攤上這事〉佣剩” “怎么了单雾?”我有些...
    開封第一講書人閱讀 163,316評論 0 353
  • 文/不壞的土叔 我叫張陵,是天一觀的道長她紫。 經(jīng)常有香客問我硅堆,道長,這世上最難降的妖魔是什么贿讹? 我笑而不...
    開封第一講書人閱讀 58,294評論 1 292
  • 正文 為了忘掉前任渐逃,我火速辦了婚禮,結(jié)果婚禮上民褂,老公的妹妹穿的比我還像新娘茄菊。我一直安慰自己疯潭,他們只是感情好,可當(dāng)我...
    茶點(diǎn)故事閱讀 67,318評論 6 390
  • 文/花漫 我一把揭開白布面殖。 她就那樣靜靜地躺著竖哩,像睡著了一般。 火紅的嫁衣襯著肌膚如雪脊僚。 梳的紋絲不亂的頭發(fā)上相叁,一...
    開封第一講書人閱讀 51,245評論 1 299
  • 那天,我揣著相機(jī)與錄音辽幌,去河邊找鬼增淹。 笑死,一個(gè)胖子當(dāng)著我的面吹牛乌企,可吹牛的內(nèi)容都是我干的埠通。 我是一名探鬼主播,決...
    沈念sama閱讀 40,120評論 3 418
  • 文/蒼蘭香墨 我猛地睜開眼逛犹,長吁一口氣:“原來是場噩夢啊……” “哼!你這毒婦竟也來了梁剔?” 一聲冷哼從身側(cè)響起虽画,我...
    開封第一講書人閱讀 38,964評論 0 275
  • 序言:老撾萬榮一對情侶失蹤,失蹤者是張志新(化名)和其女友劉穎荣病,沒想到半個(gè)月后码撰,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體,經(jīng)...
    沈念sama閱讀 45,376評論 1 313
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡个盆,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 37,592評論 2 333
  • 正文 我和宋清朗相戀三年脖岛,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片颊亮。...
    茶點(diǎn)故事閱讀 39,764評論 1 348
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡柴梆,死狀恐怖,靈堂內(nèi)的尸體忽然破棺而出终惑,到底是詐尸還是另有隱情绍在,我是刑警寧澤,帶...
    沈念sama閱讀 35,460評論 5 344
  • 正文 年R本政府宣布雹有,位于F島的核電站偿渡,受9級特大地震影響,放射性物質(zhì)發(fā)生泄漏霸奕。R本人自食惡果不足惜溜宽,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 41,070評論 3 327
  • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望质帅。 院中可真熱鬧适揉,春花似錦留攒、人聲如沸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,697評論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽。三九已至吃沪,卻和暖如春汤善,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背票彪。 一陣腳步聲響...
    開封第一講書人閱讀 32,846評論 1 269
  • 我被黑心中介騙來泰國打工红淡, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留,地道東北人降铸。 一個(gè)月前我還...
    沈念sama閱讀 47,819評論 2 370
  • 正文 我出身青樓在旱,卻偏偏與公主長得像,于是被迫代替她去往敵國和親推掸。 傳聞我的和親對象是個(gè)殘疾皇子桶蝎,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 44,665評論 2 354

推薦閱讀更多精彩內(nèi)容

  • 本文翻譯自docker官網(wǎng):https://docs.docker.com/get-started/overvie...
    wcnwyx閱讀 381評論 0 0
  • docker入門教程-概述 前言 docker其實(shí)很久以前就聽說過了,也使用過谅畅。但是很多時(shí)候都僅僅知道它是一個(gè)開源...
    Martain閱讀 436評論 0 5
  • docker-bench簡介 docker-bench用于檢查有關(guān)在生產(chǎn)中部署Docker容器的安全問題登渣。dock...
    sknfie閱讀 325評論 0 0
  • Learn how to prevent security issues and optimize contain...
    Consultant_chy閱讀 335評論 1 1
  • Docker 一、Namespace:名稱空間毡泻,主要用于容器間的資源隔離胜茧,每個(gè)容器都運(yùn)行在各自的不同的名稱空間,各...
    花花遴20102967閱讀 658評論 1 0