Docker Volume plugin for OpenPanel
-
Update Docker daemon configuration to enable third-party volume plugins. Open the
/etc/docker/daemon.json
file in a text editor with administrative privileges and add the following configuration:{ "plugins": { "volumes": { "enabled": true, "plugin_dir": "/var/lib/docker/plugins", "scan_on_start": true } } }
-
Create a folder for the OpenVolume plugin:
mkdir -p /etc/docker/plugins/openvolume
-
Download the OpenVolume plugin code:
git clone https://github.com/stefanpejcic/OpenVolume /etc/docker/plugins/openvolume
-
Build the plugin binary. Navigate to the plugin directory and compile the Go code:
cd /etc/docker/plugins/openvolume go build openvolume.go
-
Create the plugin using the compiled binary:
docker plugin create openvolume /etc/docker/plugins/openvolume/openvolume
-
Enable the plugin:
docker plugin enable openvolume
You can now use the OpenVolume plugin to create volumes with specific sizes:
docker volume create --driver openvolume --name myvolume --opt size=1GB
Replace 'myvolume' with the desired name for your volume, and adjust the size as needed.
docker volume resize myvolume --size=5G
--private
flag to limit volume to a single contianer.- list
openvolume
volumes on this host