This is a prototype. Do not use in production!
- go
- make
- systemd
- docker
make deps
Main configuration file /etc/docker/docker-confvol-plugin
Build the whole project
make build man
or in short
make
sudo -i
make
make install
systemctl daemon-reload
systemctl start docker-confvol-plugin
You can simply use a direct file mount like this
--mount volume-driver=confvol,target=/etc/nginx/conf.d/site.conf,source=dev/nginx/etc/nginx/conf.d/site.conf
Or the same with a templated configuration
--mount volume-driver=confvol,target=/etc/nginx/conf.d/site.conf,source=dev/nginx/etc/nginx/conf.d/site.conf,volume-opt=gen=1
Or you can mount folders
--mount volume-driver=confvol,target=/var/www/htdocs/,source=dev/nginx/var/www/htdocs/
For the complete example start the vagrant box, the etcd and the etcd browser. Fill the struct from examples/etcd_root to the etcd.
docker run \
--rm \
--mount volume-driver=confvol,target=/etc/nginx/conf.d/site.conf,source=dev/example/nginx/conf.d/site.conf \
--mount volume-driver=confvol,target=/var/www/htdocs/,source=dev/example/nginx/htdocs/ \
-p 8080:8080 \
-d \
nginx
A more complex example with a templated nginx
docker run \
--rm \
--mount volume-driver=confvol,target=/etc/nginx/.htpasswd,source=dev/nginx/etc/nginx/.htpasswd,volume-opt=tmpl=1 \
--mount volume-driver=confvol,target=/etc/nginx/conf.d/site.conf,source=dev/nginx/etc/nginx/conf.d/site-basicauth.conf \
--mount volume-driver=confvol,target=/var/www/htdocs/,source=dev/nginx/var/www/htdocs/ \
-p 8080:8080 \
-d \
nginx
--config=<Path>
Path to the configuration file
volume-driver=confvol
specify the drivertarget=<container-path>
mount point within the containersource=<conf-path>
configuration pathvolume-opt=tmpl=1
evaluated template filevolume-opt=mode=0644
target file mode bits (in octal)readonly
readonly mode