matchbooklab / local-persist Goto Github PK
View Code? Open in Web Editor NEWCreate named local volumes that persist in the location(s) you want
License: MIT License
Create named local volumes that persist in the location(s) you want
License: MIT License
First off, great work! I'm facing the exact same issue with named volumes and persistence (I want to create an HTPC stack in which the services need to share persisting volumes for media and downloads), but I am currently forced to use DOCs. This introduces the issue you so aptly state in the Benefits section of the Readme: every container maps the volumes to the same path.
I desperately want to use this plugin but some things do concern me:
I was thinking that it might be possible to run your containerized plugin in my Compose cluster. This way, I still have one place where I define the local mount points for the volumes used by every service. My only concern is that, apart from the extreme overhead, the volume creation takes place before the services are created, rendering the entire setup impossible. I haven't tried this yet, would such a thing even be possible?
Long story short: this should definitely be core functionality. Having to install third-party plugin software as a separate service not only introduces unnecessary complications but also goes against the Docker principle, IMHO.
Package binaries? And/or upstart example scripts? Systemd? What are all these crazy linux starty thingies, anyways?! Figure these things out, man!
Hi,
Just wondering if this plugin confers any benefits in terms of data backups, restoration and migration?
I wonder if it is warranted to add an example of the above 3 exercises to the readme?
I would like to mount only one file like this:
docker-compose.yml example:
version: '3'
services:
nginx:
image: nginx
volumes:
- nginx-configfile:/etc/nginx/nginx.conf
volumes:
nginx-configfile:
driver: local-persist
driver_opts:
mountpoint: /var/lib/docker-persistent-volume/nginx/config/nginx.conf
HI,
I had a very large directory that i started using as source of local-persist, after copying some files my disc space got filled up and it crashed before starting container..
Now i need to remove the files, HOW TO remove the volume data/files?
thanks in advance..
Very important!!!!!!!!!!!!!!!!!!!!!!!
Hey, I do docker development on OSX and was hoping to see a guide on how to install this plugin on OSX.
Right now, the instructions...
To create a Docker Plugin, one must create a Unix socket that Docker will look for when you use the plugin and then it listens for commands from Docker and runs the corresponding code when necessary.
... is pretty terse. Based on this instruction, it seems that I must be an expert at both docker and unix in order to understand the practical steps to take, which seems like a high barrier for most docker noobs (myself included). What are some example steps to accomplish this, even in your OS of choice? Having some commands would serve as a starting point to translate OS specific commands.
Also, this plugin isn't supported for those of us running OSX?
This needs be to run on the Docker host. i.e. running that on a Mac won't work (and it will print a message saying as much and exit).
I can't seem to find any guides online on how to install this plugin for OSX. Is it indeed not possible? Thanks!
Gotta also figure out how to do unit tests in Go!
Hi,
How do I tell local-persist to create a volume of certain size?
Thanks
Also add instructions and a Docker command to be able to run this driver out of a container.
Is it possible to have it running outside container?
I've tried running install script in new docker-machine (bash not found, sudo can't set up services), then running it inside container (Error response from daemon: Mounts denied)
Maybe some hints to readme as well?
I have Docker set up on my Windows 10 laptop. I am trying to run local-persist from within a container as described here - https://github.com/CWSpear/local-persist#running-from-within-a-container-aka-running-on-mac-or-windows
Some clarification would go a long way.
Thanks in advance.
The local driver seems to let you create a volume multiple times with the same name, but with this driver, if you create a volume more than once, but use a different path, it seems to ignore the 2nd call. We should print an error message so the user knows it didn't get created and why.
I followed this commands
docker run --restart=unless-stopped -d -v /run/docker/plugins/:/run/docker/plugins/ -v /shareddata:/shareddata cwspear/docker-local-persist-volume-plugin
docker volume create -d local-persist -o mountpoint=/shareddata --name=test2
docker run -itd -v test2:/data/ ubuntu
docker exec -it 1df1ae82a71abd08077c451d470d2401ea5275a14cf7e6508ba02817f233f72e bin/bash
ls
data
srv
...
..
So now it showing inside the container .
cd data
touch text.txt
Ctrl+p+q
ls /shareddata
This gives empty list . basically it not working as you mentioned. please give the example , How to do it properly. The concept it very nice.
Is there any way to one to define volume size per docker volume using this driver ?
Best Regards
Hareem Haque
Twitter: @hareemca
Hello all
Fist thank you for your open source project.
I have one docker-compose like this:
version '2'
services:
image:nginx
volumes:
- nginx-config:/etc/nginx
volumes:
nginx-config:
driver: local-persist
driver_opts:
mountpoint : /path/on/host
but I want o have an variable in name local-persist volume, like this:
version '2'
services:
image:nginx
volumes:
- ${prefix}-nginx-config:/etc/nginx
volumes:
${prefix}-nginx-config:
driver: local-persist
driver_opts:
mountpoint : /path/on/host
but it returns error. is it possible and how?
Thanks a lot
I try running plugins inside container and the container exited immidiately. Docker logs only give this single line of message:
[dumb-init] /usr/bin/docker-volume-local-persist: No such file or directory
$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
cwspear/docker-local-persist-volume-plugin latest 08d2b4cce1e9 15 hours ago 24.33 MB
$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
07cf4fea5594 cwspear/docker-local-persist-volume-plugin "dumb-init /usr/bin/d" 5 seconds ago Exited (2) 5 seconds ago kickass_cori
$ docker logs kickass_cori
[dumb-init] /usr/bin/docker-volume-local-persist: No such file or directory
When this plugin is installed correctly, should running docker plugin ls
produce anything related to this plugin?
docker volume rm etfdb_pgdata
Error response from daemon: get etfdb_pgdata: error while checking if volume "etfdb_pgdata" exists in driver "local-persist": Post http://%2Frun%2Fdocker%2Fplugins%2Flocal-persist.sock/VolumeDriver.Get: dial unix /run/docker/plugins/local-persist.sock: connect: connection refused
docker version is 18.09.0, build 4d60db4
I am pretty new to docker, please let me know what else I should provide.
Why is it trying to access the web?
All these questions are for container-mode :)
What is the purpose of mapping a volume when starting the plugin...?
docker run -d \
-v /run/docker/plugins/:/run/docker/plugins/ \
-v /path/to/store/json/for/restart/:/var/lib/docker/plugin-data/ \
-v /path/to/where/you/want/data/volume/on/host/:/path/to/where/you/want/data/volume/ \
cwspear/docker-local-persist-volume-plugin
and have to do it again when using it...
docker volume create -d local-persist -o mountpoint=/data/images --name=images
The tests I made, I skipped the first -v /path/to/where/you/want/data/volume/on/host/:/path/to/where/you/want/data/volume/
and all seemed to work well.
I re-re-read the docs and I could not understand that.
Thx
Hi there,
I've started to use your plugin but I've noticed something: we automatically need to create the mount point folder.
For example, using the following command:
$ docker volume create -d local-persist -o mountpoint=/data/images --name=images
I would need to ensure first that /data/images
exists.
I think that would be nicer for the user if the folder was automatically created in the specified mountpoint based on the volume name.
E.g:
# Will create /data/images
$ docker volume create -d local-persist -o mountpoint=/data/ --name=images
# Will create /data/src
$ docker volume create -d local-persist -o mountpoint=/data/ --name=src
What do you think about that? Would you accept a PR?
Nice job by the way !
Edit: my bad, the plugin will automatically create the mount point folder. I've decided to keep the issue open because, I think it would feel better for the user to have a volume path automatically including the volume name and simpler command line use.
I was trying to determine why I could only get this error message out of the container:
[dumb-init] /usr/bin/docker-volume-local-persist: Exec format error
So I downloaded the binaries myself and checked them out:
$ curl -L https://github.com/CWSpear/local-persist/releases/download/v1.2.0/local-persist-linux-amd64 -o local-persist-linux-amd64-v1.2.0
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 598 0 598 0 0 3587 0 --:--:-- --:--:-- --:--:-- 3646
100 9356k 100 9356k 0 0 2000k 0 0:00:04 0:00:04 --:--:-- 2322k
$ file local-persist-linux-amd64-v1.2.0
local-persist-linux-amd64-v1.2.0: Mach-O 64-bit x86_64 executable
$ curl -L https://github.com/CWSpear/local-persist/releases/download/v1.1.0/local-persist-linux-amd64 -o local-persist-linux-amd64-v1.1.0
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 598 0 598 0 0 2742 0 --:--:-- --:--:-- --:--:-- 4068
100 8203k 100 8203k 0 0 2164k 0 0:00:03 0:00:03 --:--:-- 2727k
$ file local-persist-linux-amd64-v1.1.0
local-persist-linux-amd64-v1.1.0: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, not stripped
Seems that the v1.2.0 binary won't execute under a Linux kernel.
On systems where no group named 'root' exist, docker-volume-local-persist fails to start with the following error:
Starting... Found 0 volumes on startup
Group root not found
Is there a way to get around without having to add the root group?
I try to install in docker :
docker run -d
-v /run/docker/plugins/:/run/docker/plugins/
-v /home/pi/smarthome/docker_plugin/json/:/var/lib/docker/plugin-data/
-v /home/pi/smarthome/docker_plugin/data/volume/:/home/pi/smarthome/docker_plugin/data/volume/
cwspear/docker-local-persist-volume-plugin
It is stooped with error :
standard_init_linux.go:207: exec user process caused "exec format error"
[wanghs@db2 ~]$ docker-machine version
docker-machine version 0.7.0, build a650a40
[wanghs@db2 ~]$ docker version
Client:
Version: 1.11.0-rc5
API version: 1.23
Go version: go1.5.3
Git commit: 6178547
Built: Mon Apr 11 20:44:29 2016
OS/Arch: linux/amd64
Server:
Version: 1.11.0
API version: 1.23
Go version: go1.5.4
Git commit: 4dc5990
Built: Wed Apr 13 19:36:04 2016
OS/Arch: linux/amd64
[wanghs@db2 ~]$ curl -fsSL https://raw.githubusercontent.com/CWSpear/local-persist/master/scripts/install.sh | sudo bash
[sudo] password for wanghs:
Stopping docker-volume-local-persist service if running
Failed to stop docker-volume-local-persist.service: Unit docker-volume-local-persist.service not loaded.
Downloading binary:
From: https://github.com/CWSpear/local-persist/releases/download/v1.1.0/local-persist-linux-amd64
To: /usr/bin/docker-volume-local-persist
Binary download
Downloading Systemd service conf:
From: https://raw.githubusercontent.com/CWSpear/local-persist/v1.1.0/init/systemd.service
To: /etc/systemd/system/docker-volume-local-persist.service
Systemd conf downloaded
Starting docker-volume-local-persist service...
Created symlink from /etc/systemd/system/multi-user.target.wants/docker-volume-local-persist.service to /etc/systemd/system/docker-volume-local-persist.service.
● docker-volume-local-persist.service - docker-volume-local-persist
Loaded: loaded (/etc/systemd/system/docker-volume-local-persist.service; enabled; vendor preset: disabled)
Active: active (running) since 三 2016-04-20 14:33:44 CST; 28ms ago
Main PID: 94987 (docker-volume-l)
Memory: 932.0K
CGroup: /system.slice/docker-volume-local-persist.service
└─94987 /usr/bin/docker-volume-local-persist
4月 20 14:33:44 db2 systemd[1]: Started docker-volume-local-persist.
4月 20 14:33:44 db2 systemd[1]: Starting docker-volume-local-persist...
4月 20 14:33:44 db2 docker-volume-local-persist[94987]: Starting... Found 0 volumes on startup
Done! If you see this message, that should mean everything is installed and is running.
[wanghs@db2 ~]$ docker volume create -d local-persist -o mountpoint=`pwd` --name=data-images
Error response from daemon: create data-images: create data-images: Error looking up volume plugin local-persist: plugin not found
Don't forget a README, but for now, go to bed!
http: Accept error: accept unix /run/docker/plugins/local-persist.sock: accept4: too many open files; retrying in 1s
Apr 4 06:14:48 mon docker-volume-local-persist[14133]: 2016/04/04 06:14:48 http: Accept error: accept unix /run/docker/plugins/local-persist.sock: accept4: too many open files; retrying in 1s
Apr 4 06:14:49 mon docker-volume-local-persist[14133]: 2016/04/04 06:14:49 http: Accept error: accept unix /run/docker/plugins/local-persist.sock: accept4: too many open files; retrying in 1s
Hi, since this plugin wouldn't run on macOS, I am wondering if it is possible to create a new docker-machine (boot2docker), ssh into it and install this plugin directly inside the vm? I am not sure if the plugin is going to persist after docker or vm gets restarted?
I am quite surprised this feature is still not implemented natively on the latest release of docker, there's still no way to have named volume with host/data:/container/data
.
Do we need to? Can we?
Following the experiments for #26, it seems that volumes are not persisted across docker restart (or host reboot). Tested on docker 1.11.2, ubuntu 16.04.
$ docker run -d --name="docker-plugin-volume-local-persist" --restart="always" \
-v "/run/docker/plugins/:/run/docker/plugins/" \
cwspear/docker-local-persist-volume-plugin:latest
$ docker volume create -d local-persist \
-o mountpoint=/tmp/test-persist
--name=testvol
$ docker volume ls
DRIVER VOLUME NAME
local-persist testvol
$ service docker restart
$ docker volume ls
DRIVER VOLUME NAME
Any ideas?
Thx
Please support this plugin on RaspberryPi
# curl -fsSL https://raw.githubusercontent.com/CWSpear/local-persist/master/scripts/install.sh | sudo bash
linux armv6l is not supported
Hi all,
It appears that the local-persist.json
configuration file used by local-persist must be located at /var/lib/docker/plugin-data/local-persist.json
according to the following code snippet:
https://github.com/CWSpear/local-persist/blob/b28592c7a61d67aed934acb70f4b49498e497479/driver.go#L30
However, if the data-root
parameter has been changed in the docker daemon.json
, the local-persist.json
file will be placed in <data-root>/plugin-data/
, which will become an issue when local-persist tries to locate this configuration file in the future. The code should be adapted to retrieve the data-root
from the docker configuration.
A temporary solution is to create a symbolic link so that local-persist can still find its configuration file:
ln -s <data-root> /var/lib/docker/
On driver startup, I use the Docker Engine API to inspect all containers and see if they're using my driver, and add it to the internal reference if it is.
I'm not 100% sure this is "appropriate," but I have no idea how else to do it, so here we are!
If we use this with swarm and AWS ebs volumes, should this be installed on the ec2?
Any way to use with Mac?
thanks.
Hi.
My config use a VM with doker and an other VM with NFS packages.
My container works well with this config :
version: '2'
services:
web:
image: my_image
restart: always
ports:
- "8888:8000"
volumes:
- /media:/srv/media
Inside the folder media I have a new folder uploads with my files created when I upload some images.
if I change for this one (inspired by your example) :
version: '2'
services:
web:
image: my_image
restart: always
ports:
- "8888:8000"
volumes:
- media:/srv/media
volumes:
media-files:
driver: local-persist
driver_opts:
mountpoint: /home/bat/volume/media
I have this error :
ERROR: for web Cannot create container for service web: chown /home/bat/volume/media-files: operation not permitted
ERROR: Encountered errors while bringing up the project.
A folder uploads is created in my host (and NFS server) inside the media folder, the docker volume is created, but the container is not running due to this error.
All folders have chmod 777 for the test.
Thx a lot.
Config :
# Docker version
Client:
Version: 1.12.5
API version: 1.24
Go version: go1.6.4
Git commit: 7392c3b
Built: Fri Dec 16 02:42:17 2016
OS/Arch: linux/amd64
local-persist installation was made with curl -fsSL https://raw.githubusercontent.com/CWSpear/local-persist/master/scripts/install.sh | sudo bash
OS: Latest Project Atomic (CentOS 7) with Docker 1.10.3 (1.10.3-44.el7.centos is the whole version string)
I was able to get around this by compiling your code with Go 1.5. Maybe something to document/consider
docker volume create -d local-persist -o mountpoint=/mnt/filer_volume/gitlab/config --name=gitlab_config
Error response from daemon: create gitlab_config: create gitlab_config: Error looking up volume plugin local-persist: Plugin.Activate: 400 Bad Request: malformed Host header
I am running on a CentOS 7 VM.
[vagrant@www180 simpletextmsg]$ sudo curl -fsSL https://raw.githubusercontent.com/CWSpear/local-persist/master/scripts/install.sh | sudo bash -s -- --upstart
Stopping docker-volume-local-persist service if runningRedirecting to /bin/systemctl stop docker-volume-local-persist.service
Failed to stop docker-volume-local-persist.service: Unit docker-volume-local-persist.service not loaded.
Downloading binary:
From: https://github.com/CWSpear/local-persist/releases/download/v1.3.0/local-persist-linux-amd64
To: /usr/bin/docker-volume-local-persist
Binary downloadDownloading binary:
From: https://raw.githubusercontent.com/CWSpear/local-persist/v1.3.0/init/upstart.conf
To: /etc/init/docker-volume-local-persist.conf
bash: line 109: /etc/init/docker-volume-local-persist.conf: No such file or directory
[vagrant@www180 simpletextmsg]$
Use https://github.com/fatih/color to get some colored output for debugging
C:\>docker-machine create --driver virtualbox --engine-env http_proxy=http://10.0.2.2:8118 --engine-env https_proxy=http://10.0.2.2:8118 --engine-env no_proxy=10.0.2.2,loopback plugins
...
C:\>docker-machine ssh plugins
...
docker@plugins:~$ uname -a
Linux plugins 4.4.27-boot2docker #1 SMP Tue Oct 25 19:51:49 UTC 2016 x86_64 GNU/Linux
docker@plugins:~$ curl -fsSL https://raw.githubusercontent.com/CWSpear/local-persist/master/scripts/install.sh | sudo bash
sudo: bash: command not found
curl: (6) Could not resolve host: raw.githubusercontent.com
docker@plugins:~$ export http_proxy=http://10.0.2.2:8118 https_proxy=http://10.0.2.2:8118 no_proxy=10.0.2.2,loopback
docker@plugins:~$ curl -fsSL https://raw.githubusercontent.com/CWSpear/local-persist/master/scripts/install.sh | sudo bash
sudo: bash: command not found
(23) Failed writing body
docker@plugins:~$ curl -fsSL https://raw.githubusercontent.com/CWSpear/local-persist/master/scripts/install.sh | sudo sh
NOTE: sudo needed to set up and run start service
docker@plugins:~$ sudo -H -i
Boot2Docker version 1.12.3, build HEAD : 7fc7575 - Thu Oct 27 17:23:17 UTC 2016
Docker version 1.12.3, build 6b644ec
root@plugins:~# export http_proxy=http://10.0.2.2:8118 https_proxy=http://10.0.2.2:8118 no_proxy=10.0.2.2,loopback
root@plugins:~# curl -fsSL https://raw.githubusercontent.com/CWSpear/local-persist/master/scripts/install.sh | sh
NOTE: sudo needed to set up and run start service
As you can see - sudo is supported in boot2docker environment.
Here's the script I'm using.
sudo docker network create -d bridge --subnet 172.25.0.0/16 my-network
sudo docker volume create -d local-persist -o mountpoint=/home/kelceyp/pgdata --name=pgdata
sudo docker volume ls
Output of this is as expected
DRIVER VOLUME NAME
local-persist pgdata
When I create a container using the volume name however
sudo docker run -v pgdata:/var/lib/postgresql/data/pgdata/ --net=my-network --name connie-postgres -h postgres -e POSTGRES_PASSWORD=password -e PGDATA=/var/lib/postgresql/data/pgdata -d postgres
sudo docker volume ls
Output of this is
DRIVER VOLUME NAME
local 635a259e31a8ed38372faa7082046047f50964981244ac0ab0e0b1fb7cedf727
local-persist pgdata
Which I wasn't expecting
Is there something obvious that I'm doing wrong?
Many thanks in advance.
@CWSpear I learned of local-persist through your docker issue and posted about my use case there: moby/moby#19990 (comment)
It would be incredibly helpful to have a resource for finding docker volume plugins/drivers like these. Do you think it makes sense to add this to https://github.com/docker/docker/blob/master/docs/extend/plugins.md -- or is there a better spot?
Many thanks for your work!
Is there docker for windows support planned?
Similar issue: #55
I'm currently running local-persist in a Swarm 1.1.3 configuration consisting of CentOS 7 Docker 1.10.3 nodes. Local-persist works as intended but /usr/bin/docker-volume-local-persist
consumes more and more file handles over time targeting /run/docker/plugins/local-persist.sock
. Even on a system without any local-perist backed file systems. Eventually docker commands will hang due to pending local-persist query with...
http: Accept error: accept unix /run/docker/plugins/local-persist.sock: accept4: too many open files; retrying in 1s
...written to the logs.
[root@docker_node_1 ~]# docker volume ls
DRIVER VOLUME NAME
local bf7b31a84a3d6a7b201ba2a17c58805dcc51a63b3e60224650bcac6ef037694a
[root@docker_node_1 ~]# date
Tue Apr 19 09:57:58 UTC 2016
[root@docker_node_1 ~]# lsof |grep -i local-persist |wc -l
168
[root@docker_node_1 ~]# date
Tue Apr 19 09:58:23 UTC 2016
[root@t-azeurw-dsn02 ~]# lsof |grep -i local-persist |wc -l
172
[root@t-azeurw-dsn02 ~]# lsof |grep -i local-persist
docker-vo 25440 root txt REG 8,1 8400488 794813 /usr/bin/docker-volume-local-persist
docker-vo 25440 root 3u unix 0xffff8802829d4380 0t0 1570859 /run/docker/plugins/local-persist.sock
docker-vo 25440 root 5u unix 0xffff8802829d0b40 0t0 1570874 /run/docker/plugins/local-persist.sock
docker-vo 25440 root 6u unix 0xffff8802829d5640 0t0 1570730 /run/docker/plugins/local-persist.sock
docker-vo 25440 root 7u unix 0xffff8802829d6180 0t0 1570732 /run/docker/plugins/local-persist.sock
docker-vo 25440 root 8u unix 0xffff8802829d4740 0t0 1570735 /run/docker/plugins/local-persist.sock
docker-vo 25440 root 9u unix 0xffff8802823e6900 0t0 1570905 /run/docker/plugins/local-persist.sock
docker-vo 25440 root 10u unix 0xffff8802823e0780 0t0 1570761 /run/docker/plugins/local-persist.sock
docker-vo 25440 root 11u unix 0xffff8802829d5280 0t0 1570776 /run/docker/plugins/local-persist.sock
docker-vo 25440 root 12u unix 0xffff8802823e2940 0t0 1570795 /run/docker/plugins/local-persist.sock
docker-vo 25440 root 13u unix 0xffff8802823e30c0 0t0 1571858 /run/docker/plugins/local-persist.sock
docker-vo 25440 root 14u unix 0xffff8802823e3c00 0t0 1571868 /run/docker/plugins/local-persist.sock
docker-vo 25440 root 15u unix 0xffff8802829d3480 0t0 1571879 /run/docker/plugins/local-persist.sock
docker-vo 25440 root 16u unix 0xffff8802823e5dc0 0t0 1571901 /run/docker/plugins/local-persist.sock
docker-vo 25440 root 17u unix 0xffff8802823e7bc0 0t0 1571910 /run/docker/plugins/local-persist.sock
docker-vo 25440 root 18u unix 0xffff8802823e7800 0t0 1571137 /run/docker/plugins/local-persist.sock
docker-vo 25440 root 19u unix 0xffff8802823e5280 0t0 1571157 /run/docker/plugins/local-persist.sock
docker-vo 25440 root 20u unix 0xffff8802823e3fc0 0t0 1571989 /run/docker/plugins/local-persist.sock
docker-vo 25440 root 21u unix 0xffff8802829d03c0 0t0 1572002 /run/docker/plugins/local-persist.sock
docker-vo 25440 root 22u unix 0xffff8802829d5dc0 0t0 1571227 /run/docker/plugins/local-persist.sock
docker-vo 25440 root 23u unix 0xffff8802829d1680 0t0 1572054 /run/docker/plugins/local-persist.sock
docker-vo 25440 root 24u unix 0xffff8802829d3fc0 0t0 1572068 /run/docker/plugins/local-persist.sock
docker-vo 25440 root 25u unix 0xffff8802823e4740 0t0 1572075 /run/docker/plugins/local-persist.sock
docker-vo 25440 root 26u unix 0xffff8802823e1e00 0t0 1572100 /run/docker/plugins/local-persist.sock
docker-vo 25440 root 27u unix 0xffff8802823e2d00 0t0 1572107 /run/docker/plugins/local-persist.sock
I am Using Docker toolbox in Windows 7. Steps are not clear about setting it up in Windows machine. Can you please explain.
Hi!
I was looking at your excellent documentation, but still can't quite grasp what it does.
I understand, that you can create host directory based default driver volumes like this:
# docker-compose.yml
services:
some-service:
volumes:
- /data/mysql:/var/lib/mysql
and that is basically the same as
# docker-compose.yml
services:
some-service:
volumes:
- data:/var/lib/mysql
volumes:
data:
driver: local-persist
driver_opts:
mountpoint: /data/mysql
with this driver.
Is this different in any way?
Or does this only affect Data volumes, which are now stored at a known location instead something random like
/data:/var/lib/docker/vfs/dir/cde167197ccc3e138a14f1a4f7c0d65b32cecbada822b0db4cc92e79059437a9
Could you list/elaborate the disadvantages the default local
drivers has?
I fail to see the difference between this driver and the mounted host directory data container.
Thanks for your time!
I'm stuck on the mountpoint
opt in my docker swarm - I'd like to mount /mnt/app/volumes/data
but as docker inspect
shows the source dir sticks to the stacks yml file directory...
/mnt/app/volumes/data
to /data
/mnt/app
to /data
cat /mnt/app/compose-stack.yml
version: "3"
services:
app:
volumes:
- appdata:/data
...
volumes:
appdata:
driver: local-persist
driver_opts:
mountpoint: /mnt/app/volumes/data
docker stack deploy -c /mnt/app/compose-stack.yml app
docker inspect ID
...
{
"Type": "volume",
"Name": "app_appdata",
"Source": "/mnt/app",
"Destination": "/data",
"Driver": "local-persist",
"Mode": "",
"RW": true,
"Propagation": ""
}
...
I am trying to test the local-persist volume driver, but faced the following error:
This happens on a ubuntu 16.04 configured by docker-machine.
$ docker run -d \
-v /run/docker/plugins/:/run/docker/plugins/ \
-v /var/local/docker-volume--local-persist/:/data2/ \
cwspear/docker-local-persist-volume-plugin
$ docker volume create -d local-persist -o mountpoint=/images4 --name=images4v
$ docker volume ls
DRIVER VOLUME NAME
local-persist images4v
$ docker run -it --rm -v images4v:/abc ubuntu bash
docker: Error response from daemon: Container command 'bash' not found or does not exist..
$ docker run -it --rm -v imagesPlainLocal:/abc ubuntu bash
root@41f6173bb9cf:/#
Any ideas?
Thx
Im install in manual mode the plugin on my CoreOS, but docker don't know about it docker volume create -d docker-volume-local-persist -o mountpoint=/opt/data/rethinkdb --name=rethinkdb_data
Error response from daemon: create rethinkdb_data: create rethinkdb_data: Error looking up volume plugin docker-volume-local-persist: plugin not found
I have no directory plugin-data
in /var/lib/docker
Can somebody help, how i can debug this?
When i login to system, they warn me Failed Units: 1 docker-volume-local-persist.service
and the status sudo systemctl status docker-volume-local-persist
showing us that trace:
● docker-volume-local-persist.service - docker-volume-local-persist
Loaded: loaded (/etc/systemd/system/docker-volume-local-persist.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Fri 2016-10-14 15:15:14 UTC; 9h ago
Main PID: 27230 (code=exited, status=203/EXEC)
Oct 14 15:15:14 Tempest systemd[1]: Started docker-volume-local-persist.
Oct 14 15:15:14 Tempest systemd[1]: docker-volume-local-persist.service: Main process exited, code=exited, status=203/EXEC
Oct 14 15:15:14 Tempest systemd[1]: docker-volume-local-persist.service: Unit entered failed state.
Oct 14 15:15:14 Tempest systemd[1]: docker-volume-local-persist.service: Failed with result 'exit-code'.
Hi,
Have you thought of adding a feature/flag/mode to allow the creation of folder on the docker host when setting up the container and when mounting volumes?
Currently, to use local-persist in docker-compose, I need to make sure the folders exist, which in turns requires an external script.
Being able to have the folders create automatically in the docker host, we would have a smoother experience.
Thx
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.