神刀安全网

Docker volume driver for Google Cloud Engine disks

docker-volume-gce Docker volume driver for Google Cloud Engine disks

Docker volume driver for Google Cloud Engine disks.

This driver is designed to run inside of a GCE instance, being able to attach, format and mount persistent-disks to the instance, just as Kubernetes at Google Container Engine does.

Installing

The recommended way to install docker-volume-gce is use the provided docker image.

Run the driver using the following command:

docker run -d -v /:/rootfs -v /etc/docker:/etc/docker -p 5678:5678 --privileged mcuadros/docker-volume-gce

privileged is required since the driver needs low level access to the host mount namespace, the driver mounts, umounts and format disk.

The instance requires Read/Write privileges to Google Compute Engine.

Usage

Persistent disk creation

Using docker volume create a new disk is created.

docker volume create --driver=gce --name my-disk -o SizeGb=90

Using a disk on your container

Just add the flags --volume-driver=gce and the -v <disk-name>:/data to any docker run command:

docker run -ti -v my-disk:/data --volume-driver=gce busybox sh

If the disk already exists will be used, if not a new one with the default values will be created (Standard/500GB)

The disk is attached to the instance, if the disk is not formatted also is formatted with ext4 , when the container stops, the disk is unmounted and detached.

License

MIT, seeLICENSE

转载本站任何文章请注明:转载至神刀安全网,谢谢神刀安全网 » Docker volume driver for Google Cloud Engine disks

分享到:更多 ()

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
分享按钮