Docker play <含安装后出现panic kernel解决方案,亲身体验>

本文记录了在Ubuntu 12.04.5上安装Docker的步骤,按照官方文档进行操作,遇到kernel panic问题。解决办法是通过recovery mode进入root,编辑配置文件挂载cgroup以修复问题。安装Docker后,需熟悉基本命令以充分利用其便利性。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

https://www.docker.com/ 详实的资料

其实你需要的是这个 https://docs.docker.com/

我使用的安装平台为ubuntu12.04.5 内核3.13(必须,文档上要求)

https://docs.docker.com/installation/ubuntulinux/

一步一步按照上面做

  1. Log into your Ubuntu installation as a user with sudo privileges.

  2. Verify that you have wget installed.

    $ which wget

    If wget isn't installed, install it after updating your manager:

    $ sudo apt-get update $ sudo apt-get install wget
  3. Get the latest Docker package.

    $ wget -qO- https://get.docker.com/ | sh

    The system prompts you for your sudo password. Then, it downloads and installs Docker and its dependencies.

  4. Verify docker is installed correctly.

    $ sudo docker run hello-world

    This command downloads a test image and runs it in a container.

装好之后,我看到提示将自己普通用户添加docker使用权限

sudo usermod -aG docker 你的用户名

         然后你就可以开始享受docker的便捷与轻巧了

         一些简单的命令就不说了,多练习一下能够使用得差不多了,详见https://docs.docker.com/userguide/

        装完后,玩了一会docker过下瘾,然后就跑去睡了,第二天起来开机,挂了

        出现kernel panic,提示大概意思是找不到root分区之类的信息,傻了,常用了alt+srq+reisub都没用了,估计kernel都没启动

        怎么都想不通啊,获取翻文档。

        好家伙,忘记挂cgroup了。好吧,改!

        先用recovery mode进root 挂分区得到写权限

       

  1. Edit the /etc/default/grub file.

  2. Set the GRUB_CMDLINE_LINUX value as follows:

    GRUB_CMDLINE_LINUX="cgroup_enable=memory swapaccount=1"
  3. Save and close the file.

  4. Update GRUB.

    $ sudo update-grub
  5. Reboot your system.

 做完后,谢天谢地,重启成功,然后喜滋滋继续用伪苹果了



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值