1. Docker 这个容器包含下面的东西
-
A native Linux container format that Docker calls libcontainer.
-
Linux kernel namespace: which provides isolation for filesystem, processes, and networks.
-
Filesystem isolation: each container is its own root filesystem.
-
Process isolation: each container runs in its own process environment.
-
Network isolation: separate virtual interfaces and IP addressing between containers.
-
Resource isolation and grouping: resource like CPU and memory are allocated individually to each
-
Docker container using the cgroups kernel feature.
-
Copy-on-write: filesystem are created with copy-on-write.
-
logging: STDOUT,STDERR, STDIN from the container are collected, logged, and available for analysis or trouble-shooting.
-
Interactive shell: you can create a pseudo-tty and attach to STDIN to provide an interactive shell to your container.
2.Docker安装需要满足的条件
-
Kernel 3.16 or later kernel.
-
Device mapper
-
AUFS
-
vfs
-
btrfs
-
ZFS( introduced in Docker 1.7)
-
cgroups and namespace kernel features must be supported and enabled.
检查各种条件是不是满足了:
-
#confirm device-mapper is installed.
-
ls -l /sys/class/misc/device-mapper
-
#check for Device Mapper in proc on Debian/Ubuntu
-
grep device-mapper /proc/devices
-
#loading the Device Mapper module
-
modprobe dm_mod
3. 开始安装Docker
-
#install docker-engine
-
apt-get update
-
apt-get install -y apt-transport-https ca-certificates
-
apt-get install dirmngr
-
#add the appropriate PGP key
-
apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
-
#add the appropriate Docker source entry.
-
echo 'deb debian-stretch main' >> /etc/apt/sources.list.d/docker.list
-
#apt-get update again.
-
apt-get update
-
#install Docker
-
apt-get install docker-engine
4. 碰到的问题, 该出错信息位于term.log。
-
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文件,
-
/var/log/apt/history.log
-
/var/log/dpkg.log
-
/var/log/apt/term.log
-
root@kali:/usr/local/src/scheme# dpkg -l |grep aufs
-
ii aufs-dkms 4.9+20161219-2 amd64 DKMS files to build and install aufs
-
ii aufs-tools 1:4.1+20161219-1 amd64 Tools to manage aufs filesystems
-
root@kali:/usr/local/src/scheme# dpkg -s aufs-dkms
-
Package: aufs-dkms
-
Status: install ok installed
-
Priority: optional
-
Section: kernel
-
Installed-Size: 891
-
Maintainer: Filesystems Group <filesystems-devel@lists.alioth.debian.org>
-
Architecture: amd64
-
Multi-Arch: foreign
-
Source: aufs
-
Version: 4.9+20161219-2
-
Depends: dkms (>= 2.1.0.0), linux-kbuild-4.9
-
Recommends: aufs-tools
-
Suggests: aufs-dev
-
Description: DKMS files to build and install aufs
-
The aufs driver provides a union mount for Linux filesystems. It allows one
-
to virtually merge the contents of several directories and/or stack them, so
-
that file changes in the aufs union mount end up as changes in only one
-
of the source directories.
-
.
-
This package contains the DKMS files to build and install aufs.
-
.
-
To install this package, you have to install the header files for your current
-
kernel manually (usually included in the "linux-headers-").
-
Homepage: http://aufs.sourceforge.net/
然后我检查了两个依赖关系,dkms, 和linux-kbuild-4.9.所有的依赖关系都满足,也许是我的kernel 是4.7版本的问题吗?
我决定直接ignore这个错误。直接来启动docker .
5. 启动Docker
-
#startup docker
-
service docker start
-
systemctl status docker
-
#check docker information
-
docker version
-
docker info
6. get First container.
-
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/
阅读(5717) | 评论(0) | 转发(0) |