Bocker是一个用大约100行代码实现的Docker。
依赖:
btrfs-progs
curl
iproute2
iptables
libcgroup-tools
util-linux>=2.25.2
coreutils>=7.5
基本使用方法:
$ bocker pull centos 7######################################################################## 100.0%######################################################################## 100.0%######################################################################## 100.0%Created: img_42150$ bocker imagesIMAGE_ID SOURCEimg_42150 centos:7$ bocker run img_42150 cat /etc/centos-releaseCentOS Linux release 7.1.1503 (Core)$ bocker psCONTAINER_ID COMMANDps_42045 cat /etc/centos-release$ bocker logs ps_42045CentOS Linux release 7.1.1503 (Core)$ bocker rm ps_42045Removed: ps_42045$ bocker run img_42150 which wgetwhich: no wget in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin)$ bocker run img_42150 yum install -y wgetInstalling : wget-1.14-10.el7_0.1.x86_64 1/1Verifying : wget-1.14-10.el7_0.1.x86_64 1/1Installed : wget.x86_64 0:1.14-10.el7_0.1Complete!$ bocker psCONTAINER_ID COMMANDps_42018 yum install -y wgetps_42182 which wget$ bocker commit ps_42018 img_42150Removed: img_42150Created: img_42150$ bocker run img_42150 which wget/usr/bin/wget$ bocker run img_42150 cat /proc/1/cgroup...4:memory:/ps_421523:cpuacct,cpu:/ps_42152$ cat /sys/fs/cgroup/cpu/ps_42152/cpu.shares512$ cat /sys/fs/cgroup/memory/ps_42152/memory.limit_in_bytes512000000$ BOCKER_CPU_SHARE=1024 \ BOCKER_MEM_LIMIT=1024 \ bocker run img_42150 cat /proc/1/cgroup...4:memory:/ps_421883:cpuacct,cpu:/ps_42188$ cat /sys/fs/cgroup/cpu/ps_42188/cpu.shares1024$ cat /sys/fs/cgroup/memory/ps_42188/memory.limit_in_bytes1024000000当前实现的功能:
dockerbuild†
dockerpull
dockerimages
dockerps
dockerrun
dockerexec
dockerlogs
dockercommit
dockerrm/dockerrmi
Networking
QuotaSupport/CGroups
评论