• www.tbplay777.com通宝娱乐|www.tbplay777.com通宝娱乐【唯一授权官网】

  • 发布时间:2016-01-15 14:52 | 作者:yc | 来源:互联网 | 浏览:1200 次
  • www.tbplay777.com通宝娱乐|www.tbplay777.com通宝娱乐【唯一授权官网】

    Docker是一个开源的引擎,能够轻松的为任何应用创立一个轻量级的、可移植的、自给自足的容器

    开拓者在条记本上编译测试经由过程的容器能够批量地在出产情况中部署,包孕VMs(虚拟机)、bare metal、OpenStack集群和其余的根底应用渠道

    Docker的源代码整个是用Go言语写的

    一、根底情况

    1、人物、ip、版别、内核

    serverA 10.1.10.236 3.16.0-4-amd64 8.1 docket

    www.tbplay777.com通宝娱乐|www.tbplay777.com通宝娱乐【唯一授权官网】

    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.io

    Reading package lists... Done

    Building dependency tree

    Reading state information... Done

    The following extra packages will be installed:

    aufs-tools cgroupfs-mount git git-man libapparmor1 liberror-perl libnih-dbus1 libnih1 makedev mountall plymouth

    Suggested 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-base

    plymouth-themes

    The following NEW packages will be installed:

    aufs-tools cgroupfs-mount docker.io git git-man libapparmor1 liberror-perl libnih-dbus1 libnih1 makedev mountall plymouth

    0 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 --version

    Docker 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 debian

    latest: Pulling from debian

    843e2bded498: Pull complete

    8c00acfb0175: Pull complete

    debian:latest: The imagewww484848.com 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:d9168a2c1889b4c9d44952a23065c29bdf4

    Status: Downloaded newer image for debian:latest

    2)拉取centos镜像

    docker pull centos

    Pulling repository centos

    0f73ae75014f: Download complete

    47d44cb6f252: Download complete

    f6f39725d938: Download complete

    f9a8cbc8dd13: Download complete

    f37e6a610a37: Download complete

    Status: Downloaded newer image for centos:latest

    www.tbplay777.com通宝娱乐|www.tbplay777.com通宝娱乐【唯一授权官网】

    7、反省镜像

    docker images

    REPOSITORYTAGIMAGE IDCREATEDVIRTUAL SIZE

    debianlatest8c00acfb01753 weeks ago125.2 MB

    centoslatest0f73ae75014f3 weeks ago172.3 MB

    8、运转名为debian镜像的容器(虚拟出1个debian体系)

    1)运转debian镜像的容器

    docker run -i -t debian

    2)反省版别

    :~# docker run debian cat /etc/debian_version

    8.2

    3)反省IP(是dhcp取得 每次取得都不相同)

    :~# docker run debian ip a

    1: lo:mtu 65536 qdisc noqueue state UNKNOWN group default

    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00

    inet 127.0.0.1/8 scope host lo

    valid_lft forever preferred_lft forever

    inet6 ::1/128 scope host

    valid_lft forever preferred_lft forever

    24: eth0:mtu 1500 qdisc noqueue state DOWN group default

    link/ether 02:42:ac:11:00:0b brd ff:ff:ff:ff:ff:ff

    inet 172.17.0.11/16 scope global eth0

    valid_lft forever preferred_lft forever

    inet6 fe80::42:acff:fe11:b/64 scope link tentative

    valid_lft forever preferred_lft forever

    4)反省内核

    :~# docker run debian uname -r

    3.16.0-4-amd64

    5)反省硬盘分区状况

    :~# docker run -i -t debian df -Th

    FilesystemTypeSizeUsed Avail Use% Mounted on

    noneaufs9.1G1.6G7.1G18% /

    tmpfstmpfs115M0115M0% /dev

    shmtmpfs64M064M0% /dev/shm

    /dev/sda1ext49.1G1.6G7.1G18% /etc/hosts

    9、运转名为centos镜像的容器(虚拟出1个centos体系)

    1)运转centos镜像的容器

    docker run -i -t c翡翠公主老虎机entos

    2)反省版别

    :~# docker run centos cat /etc/redhat-release

    CentOS Linux release 7.1.1503 (Core)

    3)反省内核

    :~# docker run centos uname -r

    3.16.0-4-amd64

    4)反省ip

    :~# docker run centos ip a

    1: lo:mtu 65536 qdisc noqueue state UNKNOWN

    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00

    inet 127.0.0.1/8 scope host lo

    valid_lft forever preferred_lft forever

    inet6 ::1/128 scope host

    valid_lft forever preferred_lft forever

    46: eth0:mtu 1500 qdisc noqueue state DOWN

    link/ether 02:42:ac:11:00:16 brd ff:ff:ff:ff:ff:ff

    inet 172.17.0.22/16 scope global eth0

    valid_lft forever preferred_lft forever

    inet6 fe80::42:acff:fe11:16/64 scope link tentative

    valid_lft forever preferred_lft forever

    5)反省硬盘分区状况

    :~# docker run centos df -Th

    FilesystemTypeSizeUsed Avail Use% Mounted on

    rootfsrootfs9.1G1.6G7.1G18% /

    noneaufs9.1G1.6G7.1G18% /

    tmpfstmpfs115M0115M0% /dev

    shmtmpfs64M064M0% /dev/shm

    /dev/sda1ext49.1G1.6G7.1G18% /etc/hosts

    tmpfstmpfs115M0115M0% /proc/kcore

    tmpfstmpfs115M0115M0% /proc/timer_stats

    三、参阅文章

    http://www.docker.org.cn/book/docker.html

    https://docs.docker.com/linux/started/

    这篇文章出自 “” 博客,请必须保存此出处http://.blog.51cto.com//

  • 相关内容

友情链接: