dockerはbusyboxのみを起動でき、高度なコンテナは起動できません.CentOS 6はカーネルをアップグレードします.

2790 ワード

1.busyboxを起動することができ、バックグラウンドで高級容器を起動して直接退出し、起動時に容器に入るヒント:FATAL:kernel tooold
[root@l ~]# docker run -it centos
FATAL: kernel too old

2.カーネルの表示:
[root@l ~]# uname -r
2.6.32-696.el6.x86_64

3.public keyのインポート
[root@l ~]# rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org

4.ELRepoをインストールする:
[root@l ~]# rpm -Uvh http://www.elrepo.org/elrepo-release-6-8.el6.elrepo.noarch.rpm

5.Kernelのアップグレード(ELRepoでは2つのカーネルオプションがあります.1つはkernel-lt(長期サポートバージョン)、1つはkernel-ml(プライマリラインの最新バージョン)です.
# kernel-lt       
yum --enablerepo=elrepo-kernel install kernel-lt -y 
or
# kernel-ml
yum --enablerepo=elrepo-kernel install kernel-ml -y 

6.起動項目vim/etc/grubを修正する.conf
[root@CQ-TX-01-01 ~]# vim /etc/grub.conf 

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/sda2
#          initrd /initrd-[generic-]version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (4.4.199-1.el6.elrepo.x86_64)
        root (hd0,0)
        kernel /vmlinuz-4.4.199-1.el6.elrepo.x86_64 ro root=UUID=ca8b48f9-0f24-4604-b2a5-e97b4b8c7f3a rd_NO_LUKS LANG=en_US.UTF-8 rd_NO_MD  KEYTABLE=us SYSFONT=latarcyrheb-sun16 crashkernel=auto rd_NO_LVM rd_NO_DM rhgb quiet rhgb quiet
        initrd /initramfs-4.4.199-1.el6.elrepo.x86_64.img
title CentOS (2.6.32-754.23.1.el6.x86_64)
        root (hd0,0)
        kernel /vmlinuz-2.6.32-754.23.1.el6.x86_64 ro root=UUID=ca8b48f9-0f24-4604-b2a5-e97b4b8c7f3a rd_NO_LUKS LANG=en_US.UTF-8 rd_NO_MD  KEYTABLE=us SYSFONT=latarcyrheb-sun16 crashkernel=auto rd_NO_LVM rd_NO_DM rhgb quiet rhgb quiet
        initrd /initramfs-2.6.32-754.23.1.el6.x86_64.img
title CentOS 6 (2.6.32-696.el6.x86_64)
        root (hd0,0)
        kernel /vmlinuz-2.6.32-696.el6.x86_64 ro root=UUID=ca8b48f9-0f24-4604-b2a5-e97b4b8c7f3a rd_NO_LUKS LANG=en_US.UTF-8 rd_NO_MD  KEYTABLE=us SYSFONT=latarcyrheb-sun16 crashkernel=auto rd_NO_LVM rd_NO_DM rhgb quiet rhgb quiet
        initrd /initramfs-2.6.32-696.el6.x86_64.img

7.reboot再起動
8.カーネルの再表示:
[root@l ~]# uname -r
4.4.199-1.el6.elrepo.x86_64

9.カーネルのアップグレードに成功し、コンテナの再実行に成功した
[root@l ~]# docker run -p 27017:27017 -v /mnt/mongo/db:/data/db --name docker_mongodb -d mongo --auth
92ab1d0c127801fada8586cf1cf2b3c42728eea253e0ec860011cae2373184cb
[root@l ~]# docker exec -it 92 bash
root@92ab1d0c1278:/# mongo
。。。。。。。。。。。。。。。。。。。。。