centos6.5 under Docker Learning notes _docker

Source: Internet
Author: User
Tags docker ps docker run

centos6.5 operating system, Docker learning notes.

Upgrading the centos6.5 kernel
The official documentation requires a minimum of 3.8 Linux kernel, and Docker can only run on 64-bit systems. Because the kernel version of RHEL6 and CentOS6 is 2.6, you must upgrade the kernel first.
1, yum installation with Aufs module of the 3.10 core;

CD/ETC/YUM.REPOS.D 
wget http://www.hop5.in/yum/el6/hop5.repo
yum Install Kernel-ml-aufs Kernel-ml-aufs-devel

2, modify grub's main configuration file/etc/grub.conf, set the Default=0, the first title under the content of the default starting kernel (generally newly installed kernel in the first position);
3. View kernel after reboot

Uname-r

Http://dockerpool.com/static/books/docker_practice/index.html

Install Command:
Yum-y Install Docker-io

Change configuration file

Vi/etc/sysconfig/docker

Other-args column changed to: other_args= "–exec-driver=lxc–selinux-enabled"

Start the Docker service

Service Docker start

Add Docker to boot

Chkconfig Docker on

Search Mirror

Docker Search CentOS

Getting mirrors

Docker Pull Xxx.com/centos

Listing local Mirrors

Docker images

Start container

Docker Run-t-I. Centos/bin/bash

The-t option lets Docker assign a pseudo terminal (Pseudo-tty) and bind to the container's standard input.
-I keeps the standard input of the container open.

Exit container

Exit

Update container

Docker commit-m "Operation Desc"-A "Docker user" 0b2616b0e5a8 Ouruser/sinatra:v2

-M to specify the presentation information, just like the version control tool we use;
-A can specify updated user information;
Then is the ID of the container used to create the mirror;
Finally, specify the warehouse name and tag information for the destination mirror.
The ID information for this mirror is returned when the creation is successful.

Exporting mirrors

Docker Save-o Centos.tar Xxxx/centos:tag

Load mirror like

Docker load--input Centos.tar

Or

Docker Load < Centos.tar

To delete a local mirror

Docker RMI Xxxx/centos:tag

Note: Docker rm is a removal container

Start container

Docker Start Sysid

Guardian State operation

Docker run-d Xxx/centos:tag/bin/sh-c "while true; do echo Hello world; Sleep 1; Done

To view container process information

Docker PS

View Container Output Information

Docker logs

Terminate container

Docker Stop Sysid

Enter the container

Docker Attach Sysid

Exit container
[Ctrl+p]+[ctrl+q]

Export container Snapshots

Docker Export Sysid >> Centos.tar

Import Container Snapshots

Docker Import Centos.tar Xxxx/newcentos

Delete Container

Docker RM Sysid

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.