Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Using Docker in RAM-Disk only

Featured Replies

This is a very special use case when you only need to run small and temporary containers with small disk usage and don't want to use your Array Disks (HDDs).

 

Note: The RAM-Disk, all containers, their data and docker.img are lost after reboot / power-outage. So you maybe want to add the code to your Go-File to automatically re-create the RAM-Disk on reboot. Of course the containers will be still lost. This means, this guide is only useful for containers which contain tools for temporary usage. Feel free to use a persistent appdata path, but of course the containers will be re-downloaded on every reboot.

 

In this example we use a 2GB RAM Disk (change count=2000 if you need more):

mkdir -p /mnt/disks/docker/appdata
mkdir /mnt/disks/docker/service
mount -t ramfs ramfs /mnt/disks/docker/appdata/
dd if=/dev/zero of=/mnt/disks/docker/appdata/docker.img bs=1M count=2000
mkfs.xfs /mnt/disks/docker/appdata/docker.img
mount -o loop /mnt/disks/docker/appdata/docker.img /mnt/disks/docker/service

 

Now /mnt/disks/docker/appdata/ is a RAM-Disk. In this path we created a 2GB xfs-formatted docker.img file, which is mounted on /mnt/disks/docker/service. By that we need to change the docker settings as follows:

image.png.b1db25126f7592979951e4d4b757769a.png.392afd4b8c87b3e0510f2e9af2604d5f.png

 

After installing a "jlesage/mkvtoolnix" container, it returns the following usage:

du -hd1 /mnt/disks/docker
2.0G    /mnt/disks/docker/appdata
651M    /mnt/disks/docker/service
2.6G    /mnt/disks/docker

 

df -ah | grep /mnt/disks/docker
none               0     0     0    - /mnt/disks/docker/appdata
/dev/loop2      2.0G  386M  1.6G  20% /mnt/disks/docker/service
tmpfs           7.7G   68K  7.7G   1% /mnt/disks/docker/service/containers
overlay         2.0G  386M  1.6G  20% /mnt/disks/docker/service/overlay2/3e72cc7e467ed786983b98fbb8273ac2f922be7dd087c87811a5dadf30c0c19a/merged

 

This means we used 651MB of the 2GB docker.img. Any data which would be written to /appdata would raise the RAM usage!

 

You want to reset everything? Execute this:

umount /mnt/disks/docker/service
umount /mnt/disks/docker/appdata
rm -r /mnt/disks/docker/*

 

  • 1 year later...

Would it be complicated to copy/move the docker-xfs.img to pool or array at shutdown and back again to ram at power up?

I have lots of unused ram so I have been thinking of this for a while. It will save lots on wear on the SSD pools.

Edited by Niklas

  • Author
1 hour ago, Niklas said:

Would it be complicated to copy/move the docker-xfs.img to pool or array at shutdown and back again to ram at power up?

Consider this modification:

 

 

 

1 minute ago, mgutt said:

Consider this modification:

 

 

 

 

I have used your script for some time, thanks! 

 

It saves much but I still have several GBs written to cache pool every day (like 30+GB). Not counting any stuff affected by mover but I also have appdata on cache of course, but nothing that should write that amount every day.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.