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

Linuxer, ex IBMer. GNU













分类: 虚拟化

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.


  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:// --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
  7. #add the appropriate Docker source entry.
  8. echo 'deb 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
    Log ended: 2017-07-14  14:28:06


  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 <>
  11. Architecture: amd64
  12. Multi-Arch: foreign
  13. Source: aufs
  14. Version: 4.9+20161219-2
  15. Depends: dkms (>=, 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:
然后我检查了两个依赖关系,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:

How to install Docker on Kali Linux 2017.1:

阅读(2770) | 评论(0) | 转发(0) |