Docker Installation and use

Source: Internet
Author: User

Docker is an open-source engine that makes it easy to create a lightweight, portable, self-sufficient container for any application. Developers who compile tests on notebooks can be deployed in batches in a production environment, including VMS (VMS), bare metal, OpenStack clusters, and other base application platforms. The source code of  docker is all written in go language. First, the basic Environment 1, role, IP, version, kernel servera 10.1.10.236 3.16.0-4-amd64 8.1 docketdocket 1.6.2 second, Install Docter1, add source echo  "Deb http://http.debian.net/debian jessie-backports main"  >>  /etc/apt/sources.list2, update source Apt-get update3, install Docker.io package 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-base  plymouth-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, view version docker --versiondocker version &NBSP;1.6.2,&NBSP;BUILD&NBSP;7C8FCA25, start service/etc/init.d/docker start[ ok ] starting  docker  (Via systEMCTL):  docker.service.6, Fetch Debian and CentOS image 1) Pull the Debian image 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 &NBSP;NEWER&NBSP;IMAGE&NBSP;FOR&NBSP;DEBIAN:LATEST2) Pull the CentOS image docker pull centospulling  Repository centos0f73ae75014f: download complete 47d44cb6f252: download complete  f6f39725d938: Download complete f9a8cbc8dd13: Download complete  f37e6a610a37: download complete status: downloaded NEWER&NBSP;IMAGE&NBSP;FOR&NBSP;CENTOS:LATEST7, view mirror docker imagesrepository           TAG                  IMAGE ID             CREATED             VIRTUAL  sizedebian              latest               8c00acfb0175         3 weeks ago         125.2  MBcentos              latest               0f73ae75014f         3&NBSP;WEEKS&NBSP;AGO&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;172.3&NBSP;MB8, run a container called the Debian image ( Virtual 1 Debian System) 1) View version [email protected]:~#  of the container running the Debian image docker run -i -t debian2) docker run debian cat /etc/debian_version8.23) View IP (is not the same as DHCP get   get each time) [email  Protected]:~# docker run debian ip a1: lo: <loopback,up,lower_up>  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 forever24: eth0:  <no-carrier,broadcast,up,lower_up> 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&NBSP;FOREVER4) View Kernel        [email protected]:~#  docker run debian uname -r3.16.0-4-amd645) View hard disk partitioning [Email protected]:~# docker  run -i -t debian df -ThFilesystem     Type    Size  Used Avail Use% Mounted onnone            aufs   9.1g  1.6g  7.1g  18% /tmpfs           tmpfs  115M     0  115M    0% /devshm            tmpfs    64m     0   64m   0% /dev/shm/dev/sda1       ext4   9.1g  1.6g  7.1g  18% &NBSP;/ETC/HOSTS9, running a container named CentOS Mirror (virtual out of 1 CentOS systems) 1) running the CentOS image container Docker run -i -t centos2) View version [email protected]:~# docker run centos cat /etc/redhat-releasecentos  linux release 7.1.1503  (CORE) 3) view kernel [Email protected]:~# docker run centos  uname -r3.16.0-4-amd644) View Ip[email protected]:~# docker run centos ip  a1: lo: <LOOPBACK,UP,LOWER_UP> 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 forever46: eth0:  <no-carrier,broadcast,up,lower_up> 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       &NBSP;VALID_LFT&NBSP;FOREVER&NBSP;PREFERRED_LFT&NBSP;FOREVER&NBSP;&NBSP;&NBSP;&NBSP;INET6&NBSP;FE80::42:ACFF: fe11:16/64 scope  link tentative        valid_lft forever preferred_lft &NBSP;FOREVER5) View hard disk partitioning [Email protected]:~# docker run centos df -thfilesystem      Type    Size  Used Avail Use%  mounted onrootfs         rootfs  9.1g   1.6g  7.1g  18% /none            aufs    9.1G  1.6G  7.1G  18% /tmpfs           tmpfs   115m     0   115M   0% /devshm             tmpfs    64M     0   64M    0% /dev/shm/dev/sda1      ext4    9.1G  1.6G  7.1G   18% /etc/hoststmpfs          tmpfs    115M     0  115M   0% /proc/kcoretmpfs           tmpfs   115M      0  115m   0% /proc/timer_stats Third, reference article http://www.docker.org.cn/book/ docker.htmlhttps://docs.docker.com/linux/started/

This article is from the "7928217" blog, please be sure to keep this source http://7938217.blog.51cto.com/7928217/1699593

Docker Installation and use

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.