Dear Guru's,
I have a plan to run a hyper-convergent with CoreOS on digitalocean. In order to to that, these are the steps I take to create an infinit volume to be used by my containers.
docker run --rm --privileged -v /home/core/infinit:/root -v /run:/run -v /etc/docker/plugins:/var/lib/docker/plugins -it infinit/infinit bash
infinit user create --name username --fullname 'User Name'
infinit silo create filesystem --name local
infinit network create --as username --name cluster --storage local
infinit volume create --as username --network cluster --name shared
infinit volume mount --as username --name shared --mountpoint ~/mnt --allow-root-creation &
echo 'Hello world' > ~/mnt/hello.txt
cat ~/mnt/hello.txt
Everything is working great up to this point. I can even stop and remove the container and later recreate the container with
docker run --rm --privileged -v /home/core/infinit:/root -v /run:/run -v /etc/docker/plugins:/var/lib/docker/plugins -it infinit/infinit bash
infinit volume mount --as username --name shared --mountpoint ~/mnt --allow-root-creation &
cat ~/mnt/hello.txt
and the data is still there. This is expected as infinit's data is persisted at host.
Okay, next this is what I do to create a volume for other container with the container volume plugin (daemon).
docker run --rm --privileged -v /home/core/infinit:/root -v /run:/run -v /etc/docker/plugins:/var/lib/docker/plugins -it infinit/infinit bash
infinit daemon start --as username
After this the appropriate docker plugin files should be in place on the host because of the host binding at /run
and /etc/docker/plugins
. When you check with docker volume ls
, the volume is listed, cool.
Then I proceed to create a new container to use the volume with
docker run --rm -v username/shared:/infinit -it alpine ash
I can access the directory fine and even create file and read it back. Everything seems fine without error until I notice that the file I created inside the volume, hello.txt
, is missing from this mounted volume.
When I destroy this alpine container and create another one, all the data created previously in the last alpine container is gone yielding yet another empty /infinit
.
But if I were to leave the first alpine container running, data created on the first alpine is there for the second alpine container and everything seems to works fine with the volume on both of those container except for the file hello.txt
which is still missing. And this works fine until all the container mounting the volume is destroy. The next time a new container mount the volume, and everything start empty again.
The infinit version inside the container is 0.8.0.
I have continuously take features such as hub, cache, docker swarm out of the equation.
Can any of the guru's here help me with this? Do let me know if you need any other extra information.