我看過一些文章,還是有一些疑問
Docker images
A Docker image is a read-only template. For example, an image could contain an Ubuntu operating system with Apache
and your web application installed. Images are used to create Docker containers. Docker provides a simple way to
build new images or update existing images, or you can download Docker images that other people have already
created. Docker images are the build component of Docker.
Docker Registries
Docker registries hold images. These are public or private stores from which you upload or download images. The
public Docker registry is called Docker Hub. It provides a huge collection of existing images for your use. These
can be images you create yourself or you can use images that others have previously created. Docker registries are
the distribution component of Docker.
Docker containers
Docker containers are similar to a directory. A Docker container holds everything that is needed for an application
to run. Each container is created from a Docker image. Docker containers can be run, started, stopped, moved, and
deleted. Each container is an isolated and secure application platform. Docker containers are the run component of
Docker.
images安裝了我的app,但是它是readonly的,那我要update app是怎么做的?
container 相當于一個我app的dependency,而container 又是通過image創建的,這些是啥關系?
對這些概覽比較模糊,希望大俠能夠幫助講解一下
該問題來自CSDN Docker技術交流群(303806405),由版主xinshubiao整理。
uj5u.com熱心網友回復:
B: 你可以用docker commit命令 來生成一個新的imageM: Docker 相當于給你的應用做個殼子,可以塞到任何的服務器上。就像現在裝機時候那個硬碟卡子,套好往里面一塞,插好線就可以了。
A: 那就是說我部署到生產環境還需要安裝docker這個殼子?
而且 每次我有新功能上線,我是重新更新整個殼子,還是更新殼子的某一部分?
這個和我自己把app打包有什么區別(我猜測區別就是docker里面包含了一些依賴)?
或者是說從頭開始開發,測驗,部署,bug fix,更新上線。。。,這樣的一篇文章我相信幫助肯定很大
該解答來自CSDN Docker技術交流群(303806405),由版主xinshubiao整理,由于手工編輯,提問者和回答者的QQ號和昵稱沒有一一注明,只簡單用ABCD代替提問或回復, A代表提問者。 在此,先對群里參加討論的同學表示感謝。
uj5u.com熱心網友回復:
初學docker, 感覺可以和版本控制工具對比理解:image 對應 repository
container 對應 working copy
commit 對應 commit
可能作者就是按照版本控制的思路設計的吧.
uj5u.com熱心網友回復:
image 對應 changeset 或 某個版本號 可能更準確.uj5u.com熱心網友回復:
docker中的container與image的關系和資料庫中的資料庫和實體,還有類與實體的關系差不多,你可以認為image只是一個IOS檔案,而container就是在根據image創建出來的在記憶體中運行的一個具體的實體。uj5u.com熱心網友回復:
Image可以理解為一個系統鏡像,Container是Image在運行時的一個狀態。如果拿虛擬機作一個比喻的話,Image就是關機狀態下的磁盤檔案,Container就是虛擬機運行時的磁盤檔案,包括記憶體資料。
可以參考這篇文章:http://pdfwork.cn/blog/2015/docker/
uj5u.com熱心網友回復:
頂樓上,簡潔明了的回答。uj5u.com熱心網友回復:
Image 是系統一般來源是官方資源,或者比較穩定成熟的資源Container 是啟動系統后的運行時環境, 包括磁盤 + 運行的其他軟體 + 環境配置
他們之間可以互相轉換
可以看下這篇文章
http://aotu.io/notes/2016/02/27/docker/
uj5u.com熱心網友回復:
container 相當于一個我app的dependency 這句話是錯的, container 是行程, image是鏡像, 一個是存盤態一個是運行態的東西。image 每層是只讀的, 只有最上面一層是可寫的, 每次修改都在最上面這層修改。
uj5u.com熱心網友回復:
container 來自lxc,images來自作業系統.
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/80968.html
標籤:Docker
