Add doc page 'Run Dokku on External Volume'
This commit is contained in:
1 parent
ffac858566
commit
72d702a522
2 files changed
+76
No files matched your search
@@ -0,0 +1,75 @@
|
|||||||
|
# Run Dokku on External Volume
|
||||||
|
|
||||||
|
In order to leverage cloud-provider facilities like _attachable volumes_, (_a.k.a. block storage_)
|
||||||
|
the following is an easy tutorial to achieve Dokku runs on them.
|
||||||
|
|
||||||
|
## Tutorial
|
||||||
|
The following is intended to be executed on the dokku host machine as `root`.
|
||||||
|
Say, _for instance_, that our volume is mapped into the systems as `/dev/vdb1`.
|
||||||
|
|
||||||
|
Stop docker daemon
|
||||||
|
|
||||||
|
```shell
|
||||||
|
services docker stop
|
||||||
|
```
|
||||||
|
|
||||||
|
Prepare the filesystem:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
mkfs -t ext4 /dev/vdb1
|
||||||
|
mkdir /mnt/volume
|
||||||
|
mount /dev/vdb1 /mnt/volume
|
||||||
|
```
|
||||||
|
|
||||||
|
Move the old data directories:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
mv /home/dokku /home/dokku.OLD
|
||||||
|
mv /var/lib/docker /var/lib/docker.OLD
|
||||||
|
mv /var/lib/dokku /var/lib/dokku.OLD
|
||||||
|
```
|
||||||
|
|
||||||
|
Move the data on the volume
|
||||||
|
|
||||||
|
```shell
|
||||||
|
mkdir /mnt/volume/home/
|
||||||
|
mkdir /mnt/volume/var/lib/
|
||||||
|
mv /home/dokku.OLD /mnt/volume/home/dokku
|
||||||
|
mv /var/lib/dokku.OLD /mnt/volume/var/lib/dokku
|
||||||
|
mv /var/lib/docker.OLD /mnt/volume/var/lib/docker
|
||||||
|
```
|
||||||
|
|
||||||
|
Prepare the mountpoints
|
||||||
|
|
||||||
|
```shell
|
||||||
|
mkdir /home/dokku
|
||||||
|
mkdir /var/lib/dokku
|
||||||
|
mkdir /var/lib/docker
|
||||||
|
chown dokku:dokku /home/dokku # respect the original ownership
|
||||||
|
chmod 711 /var/lib/docker # respect the original permissions
|
||||||
|
```
|
||||||
|
|
||||||
|
Mount bind
|
||||||
|
|
||||||
|
```shell
|
||||||
|
mount -o bind /mnt/volume/home/dokku /home/dokku
|
||||||
|
mount -o bind /mnt/volume/var/lib/dokku /var/lib/dokku
|
||||||
|
mount -o bind /mnt/volume/var/lib/docker /var/lib/docker
|
||||||
|
```
|
||||||
|
|
||||||
|
Start docker daemon
|
||||||
|
|
||||||
|
```shell
|
||||||
|
services docker start
|
||||||
|
```
|
||||||
|
|
||||||
|
At this point all should be working fine, please check it out.
|
||||||
|
|
||||||
|
Then, let the changes be reboot-persistent
|
||||||
|
|
||||||
|
```shell
|
||||||
|
echo '/dev/vdb1 /mnt/volume ext4 defaults 0 2' | sudo tee -a /etc/fstab
|
||||||
|
echo '/mnt/volume/home/dokku /home/dokku none defaults,bind 0 0' | sudo tee -a /etc/fstab
|
||||||
|
echo '/mnt/volume/var/lib/dokku /var/lib/dokku none defaults,bind 0 0' | sudo tee -a /etc/fstab
|
||||||
|
echo '/mnt/volume/var/lib/docker /var/lib/docker none defaults,bind 0 0' | sudo tee -a /etc/fstab
|
||||||
|
```
|
||||||
@@ -155,6 +155,7 @@
|
|||||||
<a href="/{{NAME}}/advanced-usage/persistent-storage/" class="list-group-item">Persistent Storage</a>
|
<a href="/{{NAME}}/advanced-usage/persistent-storage/" class="list-group-item">Persistent Storage</a>
|
||||||
<a href="/{{NAME}}/advanced-usage/plugin-management/" class="list-group-item">Plugin Management</a>
|
<a href="/{{NAME}}/advanced-usage/plugin-management/" class="list-group-item">Plugin Management</a>
|
||||||
<a href="/{{NAME}}/advanced-usage/repository-management/" class="list-group-item">Repository Management</a>
|
<a href="/{{NAME}}/advanced-usage/repository-management/" class="list-group-item">Repository Management</a>
|
||||||
|
<a href="/{{NAME}}/advanced-usage/run-on-external-volume/" class="list-group-item">Run on External Volume</a>
|
||||||
|
|
||||||
<a href="#" class="list-group-item disabled">Community Contributions</a>
|
<a href="#" class="list-group-item disabled">Community Contributions</a>
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user