jacobalberty/unifi-docker

Feature Request: Image without MongoDB

dmke opened this issue · 2 comments

dmke commented

Currently, the image contains a MongoDB installation, which is fine for simple setups.

I would like to have an image without any MongoDB at all, because I'm running an external database server. On Ubuntu 20.04, mongodb-server adds about 240 MB to the container image:

$ docker run --rm -it ubuntu:20.04 bash
# apt update && apt upgrade -y
...
# apt install mongodb-server
...
The following NEW packages will be installed:
  libboost-filesystem1.71.0 libboost-iostreams1.71.0 libboost-program-options1.71.0
  libgoogle-perftools4 libpcap0.8 libpcrecpp0v5 libsasl2-2 libsasl2-modules
  libsasl2-modules-db libsnappy1v5 libssl1.1 libstemmer0d libtcmalloc-minimal4
  libunwind8 libyaml-cpp0.6 mongo-tools mongodb-clients mongodb-server
  mongodb-server-core
0 upgraded, 19 newly installed, 0 to remove and 0 not upgraded.
Need to get 58.5 MB of archives.
After this operation, 239 MB of additional disk space will be used.

To avoid this, one can create and install a virtual package:

apt install equivs
cd /tmp

cat >mongodb-org-server <<CONTROL
Section: database
Priority: optional
Standards-Version: 3.9.2

Package: mongodb-org-server
Version: 3.6.99
Maintainer: John Doe <johndoe@example.org>
Provides: mongodb-org-server
Replaces: mongodb-org-server
Architecture: all
Description: Provides virtual a MongoDB server
 The official Unifi Controller package has a hard dependency on to
 MongoDB, but can actually be configured to use an external instance.
 This package exists to satisfy this dependency without actually
 installing a MongoDB server.
File: /usr/bin/mongod 755
 #!/bin/sh
 sleep infinity
CONTROL

equivs-build mongodb-org-server
dpkg -i mongodb-org-server*.deb
rm -f mongodb-org-server*.deb
apt purge equivs
dmke commented

That would be a valid alternative, yes. Thanks for the link!