Skip to content

Commit

Permalink
Update to MongoDB 3.4, unifi-video 3.8.1, and fix permission problems (
Browse files Browse the repository at this point in the history
  • Loading branch information
ctindel committed Oct 8, 2017
1 parent ae5d0e3 commit e354194
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 16 deletions.
14 changes: 8 additions & 6 deletions unifi-video/Dockerfile
@@ -1,11 +1,11 @@
FROM phusion/baseimage:0.9.18
FROM phusion/baseimage:0.9.22
MAINTAINER Chad Tindel "chad@tindel.net"

# Must be passed in at build time with --build-arg
ARG UNIFI_VIDEO_VERSION
ARG UNIFI_VIDEO_DEB_URL

# We are installing mongodb 3.2 here so that the wiredtiger storage
# We are installing mongodb 3.4 here so that the wiredtiger storage
# engine will get used by default. Unifi Video starts mongod with
# the --smallfiles option, which is a config that is only relevant
# for mmapv1 storage engine. We end up with a log that says
Expand All @@ -14,18 +14,20 @@ ARG UNIFI_VIDEO_DEB_URL
# Still, would be nice to be able to override the mongod options.
#
RUN echo "debconf debconf/frontend select Noninteractive" | debconf-set-selections && \
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927 && \
echo "deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.2 multiverse" > /etc/apt/sources.list.d/mongodb-org-3.2.list && \
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C6 && \
echo "deb http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 multiverse" > /etc/apt/sources.list.d/mongodb-org-3.4.list && \
apt-get update && apt-get install -y mongodb-org && \
curl -L ${UNIFI_VIDEO_DEB_URL} -o /tmp/unifi-video.deb && \
mkdir -p /var/cache/unifi-video && \
mkdir -p /var/run/unifi-video && \
dpkg -i /tmp/unifi-video.deb || /bin/true && apt-get -yf --force-yes install && \
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
sed -i.bak 's/ulimit -H -c 200//g' /usr/sbin/unifi-video && \
sed -i.bak 's/PKGUSER=unifi-video/PKGUSER=root/g' /usr/sbin/unifi-video && \
chmod 755 /usr/sbin/unifi-video && \
chown -R root.root /var/lib/unifi-video /usr/lib/unifi-video /var/log/unifi-video
mkdir -p /usr/lib/unifi-video/certificates
#sed -i.bak 's/PKGUSER=unifi-video/PKGUSER=root/g' /usr/sbin/unifi-video && \
#chown -R unifi-video:unifi-video /var/lib/unifi-video /usr/lib/unifi-video /var/log/unifi-video && \
#chwon -R root:root /var/log/unifi-video

ADD start.sh /bin
RUN /bin/chmod +x /bin/start.sh
Expand Down
8 changes: 4 additions & 4 deletions unifi-video/Makefile
@@ -1,6 +1,6 @@
NAME = ctindel/unifi-video-controller
VERSION = 3.8.0
UNIFI_VIDEO_DEB_URL=http://dl.ubnt.com/firmwares/ufv/v$(VERSION)/unifi-video.Ubuntu14.04_amd64.v$(VERSION).deb
NAME=ctindel/unifi-video-controller
VERSION=3.8.1
UNIFI_VIDEO_DEB_URL=http://dl.ubnt.com/firmwares/ufv/v$(VERSION)/unifi-video.Ubuntu16.04_amd64.v$(VERSION).deb

.PHONY: all build test tag_latest release

Expand All @@ -10,7 +10,7 @@ build:
docker build --no-cache --build-arg UNIFI_VIDEO_VERSION=$(VERSION) --build-arg UNIFI_VIDEO_DEB_URL=$(UNIFI_VIDEO_DEB_URL) -t $(NAME):$(VERSION) --rm=true .

test:
env NAME=$(NAME) VERSION=$(VERSION) ./mocktest.sh
env NAME=$(NAME) VERSION=$(VERSION) ./mock_test.sh

tag_latest:
docker tag $(NAME):$(VERSION) $(NAME):latest
Expand Down
3 changes: 3 additions & 0 deletions unifi-video/start.sh
Expand Up @@ -32,4 +32,7 @@ fi
# We don't want the process to daemonize because we want it to run forever
# as the docker container process
echo "UFV_DAEMONIZE=false" > /etc/default/unifi-video

echo "About to run 'chown -R unifi-video:unifi-video /var/lib/unifi-video' this could take a while..."
chown -R unifi-video:unifi-video /var/lib/unifi-video
/usr/sbin/unifi-video start
6 changes: 3 additions & 3 deletions unifi/Dockerfile
@@ -1,4 +1,4 @@
FROM phusion/baseimage:0.9.19
FROM phusion/baseimage:0.9.22
MAINTAINER Chad Tindel "chad@tindel.net"

# Must be passed in at build time with --build-arg
Expand All @@ -21,9 +21,9 @@ RUN /bin/chmod +x /bin/start.sh
# want to keep any of that data around, we want our union mount to
# replace /var/lib/unifi so we remove a bunch of dirs at the end
RUN echo "debconf debconf/frontend select Noninteractive" | debconf-set-selections && \
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927 && \
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv C0A52C50 && \
echo "deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.2 multiverse" > /etc/apt/sources.list.d/mongodb-org-3.2.list && \
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C6 && \
echo "deb http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 multiverse" > /etc/apt/sources.list.d/mongodb-org-3.4.list && \
echo "deb http://www.ubnt.com/downloads/unifi/debian stable ubiquiti" > /etc/apt/sources.list.d/100-ubnt.list && \
apt-get update && apt-get install -y mongodb-org && \
apt-get install -y curl cron procps net-tools vim mongodb-org && \
Expand Down
6 changes: 3 additions & 3 deletions unifi/Makefile
@@ -1,5 +1,5 @@
NAME = ctindel/unifi-controller
VERSION = 5.5.20
NAME=ctindel/unifi-controller
VERSION=5.5.20
UNIFI_DEB_URL=http://dl.ubnt.com/unifi/$(VERSION)/unifi_sysvinit_all.deb

.PHONY: all build test tag_latest release
Expand All @@ -10,7 +10,7 @@ build:
docker build --no-cache --build-arg UNIFI_VERSION=$(VERSION) --build-arg UNIFI_DEB_URL=$(UNIFI_DEB_URL) -t $(NAME):$(VERSION) --rm=true .

test:
env NAME=$(NAME) VERSION=$(VERSION) ./mocktest.sh
env NAME=$(NAME) VERSION=$(VERSION) ./mock_test.sh

tag_latest:
docker tag $(NAME):$(VERSION) $(NAME):latest
Expand Down

0 comments on commit e354194

Please sign in to comment.