Skip to content

Instantly share code, notes, and snippets.

@mapk0y
Created June 7, 2015 20:51
Show Gist options
  • Save mapk0y/4cced99025fb4ea8f351 to your computer and use it in GitHub Desktop.
Save mapk0y/4cced99025fb4ea8f351 to your computer and use it in GitHub Desktop.
Docker 1.7.0 で追加予定の zfs を試しただけ

1.7.0rc2 で zfs が動くらしいと聞いたので動かしただけ。やったことは下にメモしてる。

docker/cli.md によると遅いらしい。

root@vagrant:~# docker info
Containers: 0
Images: 0
Storage Driver: zfs
 Zpool: dockertest
 Zpool Health: ONLINE
 Parent Dataset: dockertest
 Space Used By Parent: 64000
 Space Available: 2097088000
 Parent Quota: no
 Compression: off
Execution Driver: native-0.2
Logging Driver: json-file
Kernel Version: 3.19.0-18-generic
Operating System: Ubuntu 15.04
CPUs: 1
Total Memory: 489.1 MiB
Name: vagrant
ID: 72VR:YTKE:BBE6:XL5J:ZJ5M:7DAM:DH6G:NML5:HLHL:2PXX:S5AT:H5TM
Debug mode (server): true
File Descriptors: 10
Goroutines: 17
System Time: 2015-06-07T20:25:37.224731718Z
EventsListeners: 0
Init SHA1:
Init Path: /usr/sbin/docker
Docker Root Dir: /var/lib/docker
WARNING: No swap limit support

root@vagrant:~# docker run -it debian /bin/bash
Unable to find image 'debian:latest' locally
latest: Pulling from debian
39bb80489af7: Pull complete
df2a0347c9d0: Pull complete
debian:latest: The image you are pulling has been verified. Important: image verification is a tech preview feature and should not be relied on to provide security.
Digest: sha256:a25306f3850e1bd44541976aa7b5fd0a29beabc137f65acbac34d6918807fd6e
Status: Downloaded newer image for debian:latest
root@80003692624f:/# ps auxf
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.1  0.6  20236  3172 ?        Ss   20:27   0:00 /bin/bash
root        10  0.0  0.4  17488  2052 ?        R+   20:28   0:00 ps auxf
root@80003692624f:/# exit
root@vagrant:~#

作業内容

※ zfs 初めて触って、なんとなく動いてしまったので間違ってるかもしれない。何より普通の FS とは概念が違うので難しい

  1. 1.7.0−rc2 を build (レポジトリ引っ張ってきて、make BIND_DIR=. binary)
  2. docker を動かす環境で zfs 周りインストールする
# apt-key adv --keyserver pool.sks-keyservers.net --recv-keys E871F18B51E0147C77796AC81196BA81F6B0FC61
# apt-get update
# # libzfs-dev は多分必要ない
# apt-get --no-install-recommends install libzfs-dev ubuntu-zfs
  1. zfs の dataset (よくわかってない)を作る。
# truncate -s 2G /var/lib/docker/zfs.img
# zpool create dockertest /var/lib/docker/zfs.img
# # 確認
# zpool list
# zfs set sync=disabled dockertest
# # 確認
# zfs list
  1. docker daemon を起動する
# docker \
  --debug=true \
  --daemon=true \
  --storage-driver=zfs \
  --storage-opt zfs.fsname=dockertest

おまけ

-		return nil, fmt.Errorf("BUG: zfs get all -t filesystems -rHp '%s' should contain '%s'", options.fsName, options.fsName)
+		return nil, fmt.Errorf("BUG: zfs get all -t filesystem -rHp '%s' should contain '%s'", options.fsName, options.fsName)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment