Slim down docker image #158

Closed
opened 2025-11-11 14:08:43 -06:00 by GiteaMirror · 9 comments
Owner

Originally created by @Joly0 on GitHub (Jan 7, 2024).

Hey, this is not really a bug report, though it would be great, if the docker image could somehow be slimmed down. Currently the image downloaded is about 9GB in size. Most of it (about 5GB) comes from this command in the image: pip3 install -r requirements.txt
Its quite annoying to download this much everytime there is an update of ollama-webui, especially if the updates basically come in daily. For a slower internet connection this is a pain.

Thanks and have a great day

Originally created by @Joly0 on GitHub (Jan 7, 2024). Hey, this is not really a bug report, though it would be great, if the docker image could somehow be slimmed down. Currently the image downloaded is about 9GB in size. Most of it (about 5GB) comes from this command in the image: `pip3 install -r requirements.txt` Its quite annoying to download this much everytime there is an update of ollama-webui, especially if the updates basically come in daily. For a slower internet connection this is a pain. Thanks and have a great day
Author
Owner

@tjbck commented on GitHub (Jan 7, 2024):

Hi, Thanks for creating this issue! Testing out with slim-bookworm at the moment, and will be merged to main soon if there aren't any issues, stay tuned!

@tjbck commented on GitHub (Jan 7, 2024): Hi, Thanks for creating this issue! Testing out with slim-bookworm at the moment, and will be merged to main soon if there aren't any issues, stay tuned!
Author
Owner

@tjbck commented on GitHub (Jan 7, 2024):

We'll try to slim down some more, but if the requirements.txt is the root cause, There aren't many ways to further slim down I'm afraid. If you manage to find a way, feel free to make a PR, Thanks!

@tjbck commented on GitHub (Jan 7, 2024): We'll try to slim down some more, but if the requirements.txt is the root cause, There aren't many ways to further slim down I'm afraid. If you manage to find a way, feel free to make a PR, Thanks!
Author
Owner

@Joly0 commented on GitHub (Jan 8, 2024):

@tjbck I tried a few things i had up my sleeve but none of that really worked. I will try a few different things aswell later, but i am afraid you are right. The biggest problems are some nvidia packages, which are really large in size, though i am not sure if those are really needed by this project? I thought this is more or less only a webui for ollama and therefore those things shouldnt be needed or what am i missing?

@Joly0 commented on GitHub (Jan 8, 2024): @tjbck I tried a few things i had up my sleeve but none of that really worked. I will try a few different things aswell later, but i am afraid you are right. The biggest problems are some nvidia packages, which are really large in size, though i am not sure if those are really needed by this project? I thought this is more or less only a webui for ollama and therefore those things shouldnt be needed or what am i missing?
Author
Owner

@tjbck commented on GitHub (Jan 8, 2024):

I think they've been included because of torch python dependency (required for RAG, vector DB), I'll take a look and see if installing cpu only version reduces the size of the image, stay tuned!

@tjbck commented on GitHub (Jan 8, 2024): I think they've been included because of torch python dependency (required for RAG, vector DB), I'll take a look and see if installing cpu only version reduces the size of the image, stay tuned!
Author
Owner

@tjbck commented on GitHub (Jan 8, 2024):

@Joly0 #422 should reduce the size of the image quite a bit, removes all the nvidia dependencies for torch.

@tjbck commented on GitHub (Jan 8, 2024): @Joly0 #422 should reduce the size of the image quite a bit, removes all the nvidia dependencies for torch.
Author
Owner

@Joly0 commented on GitHub (Jan 8, 2024):

@Joly0 #422 should reduce the size of the image quite a bit, removes all the nvidia dependencies for torch.

Really cool, thanks for your work. I'll try it out and give feedback asap.

@Joly0 commented on GitHub (Jan 8, 2024): > @Joly0 #422 should reduce the size of the image quite a bit, removes all the nvidia dependencies for torch. Really cool, thanks for your work. I'll try it out and give feedback asap.
Author
Owner

@Joly0 commented on GitHub (Jan 12, 2024):

So btw, i have tested this and it is substantially smaller in size. It would be great, if the image wouldnt need to be redone everytime something changes in this repo, but thats nott hat big of an issue. Though i thought, what if there was some logic to download the newest release automatic on container startup, rather than bundling it all directly in the image. So we had a base image with all the dependencies and the actual software would be downloaded on runtime

@Joly0 commented on GitHub (Jan 12, 2024): So btw, i have tested this and it is substantially smaller in size. It would be great, if the image wouldnt need to be redone everytime something changes in this repo, but thats nott hat big of an issue. Though i thought, what if there was some logic to download the newest release automatic on container startup, rather than bundling it all directly in the image. So we had a base image with all the dependencies and the actual software would be downloaded on runtime
Author
Owner

@djismgaming commented on GitHub (Apr 25, 2024):

Though i thought, what if there was some logic to download the newest release automatic on container startup, rather than bundling it all directly in the image. So we had a base image with all the dependencies and the actual software would be downloaded on runtime

My only though would be that it would make the image not able to be used in completely offline (air gapped) systems.

@djismgaming commented on GitHub (Apr 25, 2024): > Though i thought, what if there was some logic to download the newest release automatic on container startup, rather than bundling it all directly in the image. So we had a base image with all the dependencies and the actual software would be downloaded on runtime My only though would be that it would make the image not able to be used in completely offline (air gapped) systems.
Author
Owner

@justinh-rahb commented on GitHub (Apr 25, 2024):

Though i thought, what if there was some logic to download the newest release automatic on container startup, rather than bundling it all directly in the image. So we had a base image with all the dependencies and the actual software would be downloaded on runtime

My only though would be that it would make the image not able to be used in completely offline (air gapped) systems.

Not to mention that was our original default behaviour and several people filed issues until we "fixed" it. That would be regression from their perspective. The default models impact on image size is minimal.

@justinh-rahb commented on GitHub (Apr 25, 2024): > > Though i thought, what if there was some logic to download the newest release automatic on container startup, rather than bundling it all directly in the image. So we had a base image with all the dependencies and the actual software would be downloaded on runtime > > My only though would be that it would make the image not able to be used in completely offline (air gapped) systems. Not to mention that was our original default behaviour and several people filed issues until we "fixed" it. That would be regression from their perspective. The default models impact on image size is minimal.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#158