{"id":7229,"date":"2018-02-22T09:44:12","date_gmt":"2018-02-22T01:44:12","guid":{"rendered":"http:\/\/rmohan.com\/?p=7229"},"modified":"2018-02-22T09:44:12","modified_gmt":"2018-02-22T01:44:12","slug":"centos-6-9-docker","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=7229","title":{"rendered":"CentOS 6.9 Docker"},"content":{"rendered":"<p><strong>CentOS 6.9 Docker<\/strong><\/p>\n<p>public key<\/p>\n<p>rpm &#8211;import https:\/\/www.elrepo.org\/RPM-GPG-KEY-elrepo.org<\/p>\n<p>ELRepo<br \/>\nCentos6?<\/p>\n<p>rpm -Uvh http:\/\/www.elrepo.org\/elrepo-release-6-6.el6.elrepo.noarch.rpm<\/p>\n<p>Cenos7?<\/p>\n<p>rpm -Uvh http:\/\/www.elrepo.org\/elrepo-release-7.0-2.el7.elrepo.noarch.rpm (external link)<\/p>\n<p>kernel<\/p>\n<p>yum &#8211;enablerepo=elrepo-kernel install -y kernel-lt<\/p>\n<p>yum &#8211;enablerepo=elrepo-kernel install -y kernel-ml<\/p>\n<p>vi \/etc\/grub.conf<\/p>\n<p>default<\/p>\n<p># grub.conf generated by anaconda<br \/>\n#<br \/>\ndefault=0<br \/>\ntimeout=5<br \/>\nsplashimage=(hd0,0)\/boot\/grub\/splash.xpm.gz<br \/>\nhiddenmenu<br \/>\ntitle CentOS (3.10.28-1.el6.elrepo.x86_64)<br \/>\nroot (hd0,0)<br \/>\nkernel \/boot\/vmlinuz-3.10.28-1.el6.elrepo.x86_64 ro root=UUID=0a05411f-16f2-4d69-beb0-2db4cefd3613 rd_NO_LUKS KEYBOARDTYPE=pc KEYTABLE=us rd_NO_MD crashkernel=auto.UTF-8 rd_NO_LVM rd_NO_DM rhgb quiet<br \/>\ninitrd \/boot\/initramfs-3.10.28-1.el6.elrepo.x86_64.img<br \/>\ntitle CentOS (2.6.32-431.3.1.el6.x86_64)<br \/>\nroot (hd0,0)<br \/>\nkernel \/boot\/vmlinuz-2.6.32-431.3.1.el6.x86_64 ro root=UUID=0a05411f-16f2-4d69-beb0-2db4cefd3613 rd_NO_LUKS KEYBOARDTYPE=pc KEYTABLE=us rd_NO_MD crashkernel=auto.UTF-8 rd_NO_LVM rd_NO_DM rhgb quiet<br \/>\ninitrd \/boot\/initramfs-2.6.32-431.3.1.el6.x86_64.img<\/p>\n<p>docker<\/p>\n<p>?1?selinux<\/p>\n<p>selinux LXCselinux<\/p>\n<p>vi \/etc\/selinux\/config<\/p>\n<p># This file controls the state of SELinux on the system.<br \/>\n# SELINUX= can take one of these three values:<br \/>\n# enforcing &#8211; SELinux security policy is enforced.<br \/>\n# permissive &#8211; SELinux prints warnings instead of enforcing.<br \/>\n# disabled &#8211; SELinux is fully disabled.<br \/>\nSELINUX=disabled<br \/>\n# SELINUXTYPE= type of policy in use. Possible values are:<br \/>\n# targeted &#8211; Only targeted network daemons are protected.<br \/>\n# strict &#8211; Full SELinux protection.<br \/>\nSELINUXTYPE=targeted<\/p>\n<p>Fedora EPEL<\/p>\n<p>yum -y install http:\/\/dl.fedoraproject.org\/pub\/epel\/6\/x86_64\/epel-release-6-8.noarch.rpm<\/p>\n<p>?3?docker<\/p>\n<p>docker-io<\/p>\n<p>yum install -y docker-io<\/p>\n<p>?4?docker<\/p>\n<p>service docker start<\/p>\n<p>?5?docker<\/p>\n<p>docker version<\/p>\n<p>Client version: 1.7.1<br \/>\nClient API version: 1.19<br \/>\nGo version (client): go1.4.2<br \/>\nGit commit (client): 786b29d\/1.7.1<br \/>\nOS\/Arch (client): linux\/amd64<br \/>\nServer version: 1.7.1<br \/>\nServer API version: 1.19<br \/>\nGo version (server): go1.4.2<br \/>\nGit commit (server): 786b29d\/1.7.1<br \/>\nOS\/Arch (server): linux\/amd64<\/p>\n<p>docker hello-world<\/p>\n<p>hello-world<\/p>\n<p>docker pull hello-world<\/p>\n<p>hello-world<\/p>\n<p>docker run hello-world<\/p>\n<p>Hello from Docker.<br \/>\nThis message shows that your installation appears to be working correctly.<\/p>\n<p>To generate this message, Docker took the following steps:<br \/>\n1. The Docker client contacted the Docker daemon.<br \/>\n2. The Docker daemon pulled the &#8220;hello-world&#8221; image from the Docker Hub.<br \/>\n(Assuming it was not already locally available.)<br \/>\n3. The Docker daemon created a new container from that image which runs the<br \/>\nexecutable that produces the output you are currently reading.<br \/>\n4. The Docker daemon streamed that output to the Docker client, which sent it<br \/>\nto your terminal.<\/p>\n<p>To try something more ambitious, you can run an Ubuntu container with:<br \/>\n$ docker run -it ubuntu bash<\/p>\n<p>For more examples and ideas, visit:<br \/>\nhttp:\/\/docs.docker.com\/userguide\/<\/p>\n<p>yum list installed | grep docker<\/p>\n<p>yum -y remove docker-io.x86_64<\/p>\n<p>rm -rf \/var\/lib\/docker<\/p>\n","protected":false},"excerpt":{"rendered":"<p>CentOS 6.9 Docker<\/p>\n<p>public key<\/p>\n<p>rpm &#8211;import https:\/\/www.elrepo.org\/RPM-GPG-KEY-elrepo.org<\/p>\n<p>ELRepo Centos6?<\/p>\n<p>rpm -Uvh http:\/\/www.elrepo.org\/elrepo-release-6-6.el6.elrepo.noarch.rpm<\/p>\n<p>Cenos7?<\/p>\n<p>rpm -Uvh http:\/\/www.elrepo.org\/elrepo-release-7.0-2.el7.elrepo.noarch.rpm (external link)<\/p>\n<p>kernel<\/p>\n<p>yum &#8211;enablerepo=elrepo-kernel install -y kernel-lt<\/p>\n<p>yum &#8211;enablerepo=elrepo-kernel install -y kernel-ml<\/p>\n<p>vi \/etc\/grub.conf<\/p>\n<p>default<\/p>\n<p># grub.conf generated by anaconda # default=0 timeout=5 splashimage=(hd0,0)\/boot\/grub\/splash.xpm.gz hiddenmenu title CentOS (3.10.28-1.el6.elrepo.x86_64) root (hd0,0) kernel \/boot\/vmlinuz-3.10.28-1.el6.elrepo.x86_64 ro root=UUID=0a05411f-16f2-4d69-beb0-2db4cefd3613 rd_NO_LUKS KEYBOARDTYPE=pc KEYTABLE=us [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/7229"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7229"}],"version-history":[{"count":1,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/7229\/revisions"}],"predecessor-version":[{"id":7230,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/7229\/revisions\/7230"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7229"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7229"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7229"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}