I
Immich2y ago
jake

Docker Container Size

Im running the latest immich release on an unraid instance with lots of hdd space. unRaid stores docker containers in a docker.img file and there are settings to limit it to a specific size (20gb). When running Immich, that image grows in size very quickly. Im running a scan on an external library with a lot of image (like 2-400k) and it would seem that those containers arent configured to store information externally. Are there env vars that i can set to map whatever is taking up all the space in that image to some other location?
Name Container Writable Log
immich_machine_learning 1.84 GB 102 MB 27.3 kB
homeassistant 1.83 GB 2.10 MB 27.4 MB
immich_microservices 1.80 GB 34.8 MB 436 kB
immich_server 1.80 GB 34.8 MB 48.1 kB
frigate 1.73 GB 316 kB 219 kB
Name Container Writable Log
immich_machine_learning 1.84 GB 102 MB 27.3 kB
homeassistant 1.83 GB 2.10 MB 27.4 MB
immich_microservices 1.80 GB 34.8 MB 436 kB
immich_server 1.80 GB 34.8 MB 48.1 kB
frigate 1.73 GB 316 kB 219 kB
those container sizes are after just running for an hr. compose and env files are default.
15 Replies
Alex Tran
Alex Tran2y ago
1.8 GB looks correct it doesn't store media directly on the container, it stored on upload_location your specified in .env file if it stores in your container, it will be far more greater than 1.8GB
jake
jakeOP2y ago
yep i am following there. i wonder if there is a way to mount the machine learning models elsewhere so that it isnt included in the container?
Alex Tran
Alex Tran2y ago
ah, the volume in the machine-learning-models is mounted through the model-cache volume in the docker-compose file
jake
jakeOP2y ago
btw, thanks for the quick reply. kickass app.
Alex Tran
Alex Tran2y ago
I believe you can map that to an external drive, but how to do it, you might need to search for google
Alex Tran
Alex Tran2y ago
No description
jake
jakeOP2y ago
perfect. I'll give that a try to alleviate some of the storage space. what are those two other volumes? would it be beneficial to map those as well? pgdata is postgres by the looks. i think im going to try and map both of those to see if i can save some space in that container.
ddshd
ddshd2y ago
If you map pgdata you might lose data in the database because it doesn’t know where the data is Unless you can also copy the data over to the new location, easier prob to just do a backup just in case
jake
jakeOP2y ago
im cool with that. i just started a scan and can always start from scratch. i ended up just commenting out the root volumes and mapping them in each container. i couldnt figure out how the convention should be. tried:
volumes:
pgdata:
name: "/path/to/local/volume"
volumes:
pgdata:
name: "/path/to/local/volume"
and
volumes:
pgdata: "/path/to/local/volume"
volumes:
pgdata: "/path/to/local/volume"
neither worked. the second said it needed to be a map, so i tried and object (first one) but that said name was not a valid prop. looked through the docker docs on how to do it but couldnt find anythign specific so i just went the explicit route in the containers volume mapping. if anyone knows how to mount those volumes properly to an external location that'd be great. i did see there is an external: true flag but didnt try that.
ddshd
ddshd2y ago
No description
jake
jakeOP2y ago
wow, thanks @ddshd . that is much more involved than i had expected.
ddshd
ddshd2y ago
You might just be able to change the mount under the db container itself and it would be a one line change but I don’t have the compose in front of me to say for sure You just need to add driver, driver_opts and the sub values under pgdata
Alex Tran
Alex Tran2y ago
FWIW, the size of the model cache will never reach 20GB
Alex Tran
Alex Tran2y ago
This is the production model-cache size
No description
jake
jakeOP2y ago
correct. i am just trying to limit the size where i can. i think i have some other offending containers that seem to want to grow that docker.img in size as well. just started with immich first. many thinaks. yup thats what i did. much easier for me at this point.

Did you find this page helpful?