Docker是一個開源的引擎,可以輕松的為任何應用創建一個輕量級的、可移植的、自給自足的容器。
開發者在筆記本上編譯測試通過的容器可以批量地在生產環境中部署,包括VMs(虛擬機)、bare metal、OpenStack集群和其他的基礎應用平臺。
Docker的源代碼全部是用Go語言寫的。
一、基礎環境
1、角色、ip、版本、內核
serverA 10.1.10.236 3.16.0-4-amd64 8.1 docket
docket 1.6.2
二、安裝docter
1、添加源
echo "deb http://http.debian.net/debian jessie-backports main" >> /etc/apt/sources.list
2、更新源
apt-get update
3、安裝docker.io包
apt-get install docker.ioReading package lists... DoneBuilding dependency tree Reading state information... DoneThe following extra packages will be installed:aufs-tools cgroupfs-mount git git-man libapparmor1 liberror-perl libnih-dbus1 libnih1 makedev mountall plymouthSuggested packages:btrfs-tools debootstrap lxc rinse git-daemon-run git-daemon-sysvinit git-doc git-el git-email git-gui gitk gitweb git-arch git-cvs git-mediawiki git-svn desktop-baseplymouth-themesThe following NEW packages will be installed:aufs-tools cgroupfs-mount docker.io git git-man libapparmor1 liberror-perl libnih-dbus1 libnih1 makedev mountall plymouth0 upgraded, 12 newly installed, 0 to remove and 54 not upgraded.Need to get 9,986 kB of archives.After this operation, 47.2 MB of additional disk space will be used.Do you want to continue? [Y/n]
4、查看版本
docker --versionDocker version 1.6.2, build 7c8fca2
5、啟動服務
/etc/init.d/docker start[ ok ] Starting docker (via systemctl): docker.service.
6、拉取debian和CentOS鏡像
1)拉取debian鏡像
docker pull debianlatest: Pulling from debian843e2bded498: Pull complete 8c00acfb0175: Pull complete debian:latest: The image you are pulling has been verified. Important: image verification is a tech preview feature and should not be relied on to provide security.Digest: sha256:d9168a2c1889b4c9d44952a23065c29b0656237909d618328275f42065602354Status: Downloaded newer image for debian:latest
2)拉取centos鏡像
docker pull centosPulling repository centos0f73ae75014f: Download complete 47d44cb6f252: Download complete f6f39725d938: Download complete f9a8cbc8dd13: Download complete f37e6a610a37: Download complete Status: Downloaded newer image for centos:latest
7、查看鏡像
docker imagesREPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZEdebian latest 8c00acfb0175 3 weeks ago 125.2 MBcentos latest 0f73ae75014f 3 weeks ago 172.3 MB
8、運行名為debian鏡像的容器(虛擬
docker imagesREPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZEdebian latest 8c00acfb0175 3 weeks ago 125.2 MBcentos latest 0f73ae75014f 3 weeks ago 172.3 MB
新聞熱點
疑難解答