Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1288321
  • 博文数量: 297
  • 博客积分: 285
  • 博客等级: 二等列兵
  • 技术积分: 2996
  • 用 户 组: 普通用户
  • 注册时间: 2010-03-06 22:04
个人简介

Linuxer, ex IBMer. GNU https://hmchzb19.github.io/

文章分类

全部博文(297)

文章存档

2020年(11)

2019年(15)

2018年(43)

2017年(79)

2016年(79)

2015年(58)

2014年(1)

2013年(8)

2012年(3)

分类: 虚拟化

2017-07-18 09:40:43

1. Docker 这个容器包含下面的东西

点击(此处)折叠或打开

  1. A native Linux container format that Docker calls libcontainer.
  2. Linux kernel namespace: which provides isolation for filesystem, processes, and networks.
  3. Filesystem isolation: each container is its own root filesystem.
  4. Process isolation: each container runs in its own process environment.
  5. Network isolation: separate virtual interfaces and IP addressing between containers.
  6. Resource isolation and grouping: resource like CPU and memory are allocated individually to each
  7. Docker container using the cgroups kernel feature.
  8. Copy-on-write: filesystem are created with copy-on-write.
  9. logging: STDOUT,STDERR, STDIN from the container are collected, logged, and available for analysis or trouble-shooting.
  10. Interactive shell: you can create a pseudo-tty and attach to STDIN to provide an interactive shell to your container.
2.Docker安装需要满足的条件

点击(此处)折叠或打开

  1. Kernel 3.16 or later kernel.
  2. Device mapper
  3. AUFS
  4. vfs
  5. btrfs
  6. ZFS( introduced in Docker 1.7)
  7. cgroups and namespace kernel features must be supported and enabled.
检查各种条件是不是满足了:

点击(此处)折叠或打开

  1. #confirm device-mapper is installed.
  2. ls -l /sys/class/misc/device-mapper
  3. #check for Device Mapper in proc on Debian/Ubuntu
  4. grep device-mapper /proc/devices
  5. #loading the Device Mapper module
  6. modprobe dm_mod
3. 开始安装Docker

点击(此处)折叠或打开

  1. #install docker-engine
  2. apt-get update
  3. apt-get install -y apt-transport-https ca-certificates
  4. apt-get install dirmngr
  5. #add the appropriate PGP key
  6. apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
  7. #add the appropriate Docker source entry.
  8. echo 'deb https://apt.dockerproject.org/repo debian-stretch main' >> /etc/apt/sources.list.d/docker.list
  9. #apt-get update again.
  10. apt-get update
  11. #install Docker
  12. apt-get install docker-engine

4. 碰到的问题, 该出错信息位于term.log。

点击(此处)折叠或打开

  1. Loading new aufs-4.9+20161219 DKMS files...^M
    Building for 4.7.0-kali1-amd64^M
    Building initial module for 4.7.0-kali1-amd64^M
    Error!  The dkms.conf for this module includes a BUILD_EXCLUSIVE directive which^M
    does not match this kernel/arch.  This indicates that it should not be built.^M
    Skipped.^M
    Log ended: 2017-07-14  14:28:06
我查了下apt的Log文件,

点击(此处)折叠或打开

  1. /var/log/apt/history.log
  2. /var/log/dpkg.log
  3. /var/log/apt/term.log

点击(此处)折叠或打开

  1. root@kali:/usr/local/src/scheme# dpkg -l |grep aufs
  2. ii aufs-dkms 4.9+20161219-2 amd64 DKMS files to build and install aufs
  3. ii aufs-tools 1:4.1+20161219-1 amd64 Tools to manage aufs filesystems
  4. root@kali:/usr/local/src/scheme# dpkg -s aufs-dkms
  5. Package: aufs-dkms
  6. Status: install ok installed
  7. Priority: optional
  8. Section: kernel
  9. Installed-Size: 891
  10. Maintainer: Filesystems Group <filesystems-devel@lists.alioth.debian.org>
  11. Architecture: amd64
  12. Multi-Arch: foreign
  13. Source: aufs
  14. Version: 4.9+20161219-2
  15. Depends: dkms (>= 2.1.0.0), linux-kbuild-4.9
  16. Recommends: aufs-tools
  17. Suggests: aufs-dev
  18. Description: DKMS files to build and install aufs
  19.  The aufs driver provides a union mount for Linux filesystems. It allows one
  20.  to virtually merge the contents of several directories and/or stack them, so
  21.  that file changes in the aufs union mount end up as changes in only one
  22.  of the source directories.
  23.  .
  24.  This package contains the DKMS files to build and install aufs.
  25.  .
  26.  To install this package, you have to install the header files for your current
  27.  kernel manually (usually included in the "linux-headers-").
  28. Homepage: http://aufs.sourceforge.net/
然后我检查了两个依赖关系,dkms, 和linux-kbuild-4.9.所有的依赖关系都满足,也许是我的kernel 是4.7版本的问题吗?
我决定直接ignore这个错误。直接来启动docker .

5. 启动Docker

点击(此处)折叠或打开

  1. #startup docker
  2. service docker start
  3. systemctl status docker
  4. #check docker information
  5. docker version
  6. docker info
6. get First container.

点击(此处)折叠或打开

  1. docker container run -it alpine sh


7. 参考资料:
Install Docker in Kali Linux Debian Testing:  https://macay.webhostbug.com/discussion/comment/318/

How to install Docker on Kali Linux 2017.1:  https://www.ptrace-security.com/2017/06/14/how-to-install-docker-on-kali-linux-2017-1/



阅读(2770) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~