Problem with docker packages itself is they are really big.
As example I wanted to do this on a mochabin totally different brand… the amount on the partition was 104 mb as extroot, not really much.
but then even if you gonna use for example a usb stick to add storage to a gl-inet router its still difficult you need to know alot of commands.
click to expand
Basicly what you want for package storage:
Mount one partition into /overlay, and /overlay is for docker itself readonly because its only ment for installing huge packages im not sure why its made like that, but pulling images on /overlay will fail.
Then you want to mount /opt/ with a second partition and this is for the use of docker, otherwise you will get vague errors and docker will not pull images, this hunted me in the past 
Tools you need:
fdisk e2fsprogs kmod-fs-ext4 kmod-usb-storage blkid block-mount
First you login via ssh and check if the disk exists with ls /dev/ often its callled sd, or sda or even usb, use blkid to make sure, you can also try lsusb.
To format you use:
mkfs.ext4 /dev/<usb device> this will turn it into a ext4 device, you can also use other file systems but I believe ext4 is stablest.
to partition:
use fdisk /dev/sda its important you dont select the child partition but basicly the master, then press p to see any partitions if you see any type d this is to delete it, and if you want to add one you press n then it asks you the partition number and then it gives you two options to create a primary disk or extend its always the first one so 1.
Then it asks you the begin size, just press enter, and then it asks for the end size in where you add: +1G which means you create from 0 to 1gb a partition, this is enough for your packages, you may also can use +512m it depends what suits you.
Congrats you made partition 1, the same wizard is for partition 2 you only have to specify number 2 then when it asks for the drive, and also you don’t have to add anything like +1G as you gonna use the full end.
Edit totally forgot: when done, you write ‘w’ and press enter to write the partition layout and exit fdisk.
Now we need to mount them to docker and package manager…
first we need to make a hold on the uuid table which we can read from blkid, your disk did not list?, then its likely you have to reformat the child partitions to ext4 with mkfs.ext4 /dev/sd.
Now import our disk table into block-mount by using:
block detect | uci import fstab
Then open fstab here with vi or nano: /etc/config/fstab
if correct you will see both of your partitions along with their uuid.
great!, now the only thing you have to do is:
add a section like this:
config mount 'overlay'
target '/overlay'
uuid '<paste uuid from the sda1 partition>'
config mount 'opt'
target '/opt'
uuid 'uuid from partition 2'
Then reboot, this should give you 1gb for packages from your usb device, and all the rest in /opt for docker, as for persistence im afraid you have to redo this everytime with a upgrade or maybe you can re-mount /overlay im not sure about this…
Sources:
[OpenWrt Wiki] Using storage devices
[OpenWrt Wiki] Fstab Configuration
[OpenWrt Wiki] Mounting Block Devices