自己生成docker存储
lvm创建docker存储
1
|
lvcreate -L 4G -n docker-poolmeta /dev/VolGroup00
|
1
|
lvcreate -L 200G -n docker-pool /dev/VolGroup00
|
转换lvm格式
1
|
lvconvert -- type thin-pool --poolmetadata VolGroup00 /docker-poolmeta VolGroup00 /docker-pool
|
三种方式启动,随你喜欢
命令行启动
1
|
/usr/bin/docker -d -H unix: ///var/run/docker .sock --storage-driver=devicemapper --storage-opt dm.fs=ext4 --storage-opt dm.thinpooldev= /dev/mapper/VolGroup00-docker--pool
|
修改 init的docker 改为如下格式
/etc/init.d/docker
1
|
$ exec -d -H unix: ///var/run/docker .sock --storage-driver=devicemapper --storage-opt dm.fs=ext4 --storage-opt dm.thinpooldev= /dev/mapper/VolGroup00-docker--pool &>> $logfile &
|
配置文件启动
vi /etc/sysconfig/docker
1
2
3
4
|
docker_own= "root:dockerroot"
docker_sock= "/var/run/docker.sock"
docker_listen= "0.0.0.0:2375"
other_args= "-H unix://$docker_sock -H $docker_listen --storage-driver=devicemapper --storage-opt dm.fs=ext4 --storage-opt dm.thinpooldev=/dev/mapper/VolGroup00-docker--pool"
本文转自银狐博客51CTO博客,原文链接http://blog.51cto.com/foxhound/1834851如需转载请自行联系原作者 战狐 |