This is an old revision of the document!
Docker - DokuWiki (with docker volume host directory for portability and direct access to data)
This documentation was done using Ubuntu Server 20.04 LTS as a VirtualMachine, virtualized via VirtualBox 6.1.8.
Ubuntu was configured to use LVM.
I'm assuming you already have Docker and Docker-Compose installed.
if not, go ahead and install them (sudo apt-get install docker -y && sudo apt-get install docker-compose -y)
First, after installing Ubuntu, we should expand the LVM to use the entire Fee Space available. This is/was an issue at the time of writing (17/07/2020)
sudo lvm
lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv
exit
sudo resize2fs /dev/ubuntu-vg/ubuntu-lv Confirm with: df -h |
|
Let's add ourselfs to the Docker Group so we don't have to prefix every command from Docker with 'sudo' | sudo gpasswd -a $USER docker |
Now let's create a docker volume, which points to a local folder, so we can manipulate / migrate / backup the data easily if needed. |
–driver local \ –opt type=none \ –opt device=/home/user/test \ –opt o=bind \ test_vol
Practical Example:
docker volume create \ --driver local \ --opt type=none \ --opt device=/media/share/UbuntuDocker/dokuwiki/storage/data \ --opt o=bind dokuwiki_data