ryansch / docker-unifi-rpi

Unifi Controller for Raspberry Pi 3+ and x86
https://hub.docker.com/r/ryansch/unifi-rpi/
347 stars 42 forks source link

Consider updating MongoDB to 3.6 #69

Closed loganmarchione closed 2 years ago

loganmarchione commented 3 years ago

Ubiquiti has supported MongoDB 3.6 since 5.13.10 (see any of their release posts for this).

I saw this post on r/Ubiquiti and noticed the Docker image is running MongoDB 3.2.11, which is EoL as-of September 2018. I don't see you explicitly installing MongoDB, so I'm assuming the unifi_sysvinit_all.deb package is calling mongodb-server as a dependency, which is currently 3.2.11 on Debian 9.

root@e04c034c00de:/var/lib/unifi# mongod --version
db version v3.2.11
git version: 009580ad490190ba33d1c6253ebd8d91808923e4
OpenSSL version: OpenSSL 1.0.2u  20 Dec 2019
allocator: tcmalloc
modules: none
build environment:
    distarch: x86_64
    target_arch: x86_64

I don't see MongoDB in Debian 10's repo (not sure why), so simply upgrading your base image to Debian 10 won't fix this.

According to this, you would probably need to add a few lines to the Dockerfile to add the MongoDB keys, add the repo, then install MongoDB 3.6, before installing the unifi_sysvinit_all.deb file. However, I haven't tested this. Also, I'm running on AMD64, so ARM32 and ARM64 would both need to be taken into consideration.

Another option is to run Mongo in a separate container (as shown here), but that would require updated compose files, complicated mounting of directories to use the new container, and would probably break user configs.

ryansch commented 3 years ago

@loganmarchione I'd love to do this.

My previous attempt resulted in this comment: https://github.com/ryansch/docker-unifi-rpi/issues/54#issuecomment-658853558

I haven't had free time to devote to this yet.

ryansch commented 3 years ago

I still need to come up with a consistent approach for mongo on arm.

loganmarchione commented 3 years ago

Ah ya, I see that MongoDB offers AMD64 and ARM64 builds, but not 32-bit ARMv7. That might be an issue, especially considering this is targeted at mostly RPi users. You would need to change the MongoDB install for AMD64 and ARM64, but not ARMv7, which would not be ideal.

ryansch commented 3 years ago

I've done some research on building some 3.x version of mongo for arm32v7 for use here. I need to finish that.

lukasMega commented 2 years ago

any updates here?

ryansch commented 2 years ago

Nothing to report yet.

ryansch commented 2 years ago

I have 3 pis here now configured as such:

I'm hoping to come up with a solution that works for all of them. I'm likely going to need to maintain an old version of mongodb just for this purpose.

ryansch commented 2 years ago

https://community.ui.com/questions/Mongodb-3-x-patches/ead9310d-6269-488e-9008-2607a5a93e49

kfken commented 2 years ago

With the release of 64 bit Raspbian out of beta (https://www.raspberrypi.com/news/raspberry-pi-os-64-bit/), does remove the need to have ubuntu server installed?

I'm assuming the arm64 container will also run on all pi's that run Raspbian 64bit?

ryansch commented 2 years ago

@kfken Honestly it doesn't matter what linux distro you pick, as long as you can get docker up and running on it. I just prefer ubuntu server these days.

ryansch commented 2 years ago

At long last, I'm pushing images now that are based on mongo 3.6!

loganmarchione commented 2 years ago

Linking the new issue #95 here, just in case anyone still following this issue wants to see it.