I want to create a zfs docker I need a little help, I work on ubuntu, I create 3 containers for my environment in docker. Need to use this file system with data redundancy.
-
unclear what are you asking. fix your mispells – fabrizioM Aug 26 '14 at 18:10
-
i have to create a container wich must be hosted on a ZFS file system. i have to configure a new container repository of 50 GB based on it. The developers will handle after your work the tuning of this element if needed. – Florian Chevalier Aug 26 '14 at 18:42
-
Up needs some help please :) – Florian Chevalier Aug 28 '14 at 14:30
-
If the container does not need to mount or change your actual hosts underlying ZFS, then you should not have to worry about doing anything different as you would with any other filesystem as Docker will use AUFS on top of that. You can actually have Docker use ZFS instead of AUFS, but I do not believe that is what you are asking. – jredd Sep 09 '14 at 18:37
2 Answers
I do not have a definitive answer, but I do know that in order to mount;
The container would need
CAP_SYS_ADMIN
, and perhapsCAP_MKNOD
.You can specifiy this explicitly in Docker 1.2+ using
--cap-add=""
(man capabilities
might give you an idea of what can be done if you know what you need.)Or simply:
--priveleged=True
(less explicit, less secure)docker run --cap-add="CAP_SYS_ADMIN" --cap-add="CAP_MKNOD" -i -t -v /mount/from/host:/container/mount/point --name="MYCONTAINER" repo/name /bin/bash
SE Linux Security Context:
To make your data volume aware of SELINUX Security Type (allow writing
to external volumes).
chcon -Rt svirt_sandbox_file_t /var/db
Where
/var/db
would be your mount point (ie;/mount/from/host
from eg above)
I would also read about those who successfully did the same using GlusterFS, or this, or anything using FUSE, as I suspect they would be restricted in similar ways.
This answer is not super-specific, but neither was your question :)
Edit:This answer assumed the OP was asking how to use docker with ZFS (instead of AUFS). Docker's ZFS driver support is still a work in progress at this point. To answer OP's question, I would say to just build the container as you normally would with any other FS.

- 170
- 6
-
I can post my poject statement i don't understand this statement – Florian Chevalier Sep 04 '14 at 09:04
-
Florian,
Are you asking how to create a docker container with ZFS as a backend?
In this case there is this docker fork. But I am not sure if this is compatible with a non-zfs docker host on another system.
If you only need ZFS for it`s features like COW and snapshots just create a dataset and create the container inside it
zfs create zfs_pool_name/docker_container_name
jRadds approach flies right over my head but it is a great starting point for me as well ;)
Ah, now I get it. Linux kernel capabilities are meant for fine tuning access instead of using chroot as to limit the extent of how much the system gets compromised.
Hope that helps

- 321
- 2
- 4
-
I need to create three container like that Website_Dev Debian Squeeze 1 512 MB apache2, build-¬‐ essential, php5, mysql-¬‐server-¬‐5.5, openssh-¬‐server ,Apache port 8000, MySQL port 1500 and : You must be able to create those images without doing anything manually inside the container, like installation, configuration and additional changes. All of those provision stages must be done automatically. Once images created, developers should be able to instantiate containers and push their code – Florian Chevalier Sep 09 '14 at 10:13
-
Florian, this comment does not even mention ZFS. I thought you wanted a container that can mount the hosts ZFS. You need to start another thread with your actual question after you have attempted to solve this. Check out the Docker hub for an image to use. Like this one perhaps: https://registry.hub.docker.com/u/eboraas/apache-php/ – jredd Sep 09 '14 at 18:34