更多内容可移駕至我的獨立Blog:
http://www.justfbt.com/
由于xxx的原因,直接docker pull xxxx 是無法pull成功的,試過vpn也搞不定,是以就想到在本地自己整個image,如下是實作過程…
前提:docker 已正确安裝
# docker version
Client version:
Client API version:
Go version (client): go1
Git commit (client): c8fca2
OS/Arch (client): linux/amd64
Server version:
Server API version:
Go version (server): go1
Git commit (server): c8fca2
OS/Arch (server): linux/amd64
準備: install build tool:
# debootstrap [OPTION...] SUITE TARGET [MIRROR [SCRIPT]]
SUITE
要建構的ubuntu的版本号,必須在/usr/share/debootstrap/scripts/目錄中有對應的檔案,并且與MIRROR對應。
TARGET
這裡應該是寫一個路徑,最終建構的系統就在這個路徑中。如果該路徑不存在會自動建立。
MIRROR
指定deb包的擷取路徑,與sources.list檔案中寫的路徑一樣,比如http://mirrors.aliyun.com/ubuntu/(我用的aliyun的鏡像服務)
建構ubuntu trusty(ubuntu14.04)指令
# pwd
root@ubuntu1404:/data/dockerimages
# debootstrap trusty ./trusty/ http://mirrors.aliyun.com/ubuntu/
# tar -cf ./ubuntu-trusty.tar ./trusty
import image
verfy:
list current images
# docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
trusty latest bb95053b seconds ago MB
update …
國内可用鏡像:
阿裡雲Docker鏡像庫
dockerpool