From 8b182fdc9f1104cd6a2bf5f5b18db02531e2eab0 Mon Sep 17 00:00:00 2001 From: Marcus Klein Date: Sun, 5 Nov 2017 20:02:11 +0100 Subject: [PATCH] Dockerfile for using motioneye from current Git checkout works. Need to move some path specifications around for this. --- .travis.yml | 23 ++++---- extra/Dockerfile | 2 +- extra/Dockerfile.armv7-armhf | 2 +- extra/Dockerfile.local | 101 +++++++++++++++-------------------- 4 files changed, 59 insertions(+), 69 deletions(-) diff --git a/.travis.yml b/.travis.yml index 769546a..a6ef73c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,16 +1,11 @@ +dist: trusty sudo: required + language: bash + services: - docker -before_install: - - docker info - - docker run --rm --privileged multiarch/qemu-user-static:register --reset -install: - - docker build --build-arg VCS_REF=$TRAVIS_COMMIT --build-arg BUILD_DATE=$(date +"%Y-%m-%dT%H:%M:%SZ") -t $DOCKER_REPO:$TRAVIS_BRANCH-$TARGET -f extra/Dockerfile${EXT} extra - - docker run --rm $DOCKER_REPO:$TRAVIS_BRANCH-$TARGET uname -a -after_success: - - docker login -e=$DOCKER_EMAIL -u=$DOCKER_USERNAME -p=$DOCKER_PASSWORD - - docker push $DOCKER_REPO:$TRAVIS_BRANCH-$TARGET + env: # global: # DOCKER_REPO @@ -22,3 +17,13 @@ env: - TARGET=armhf EXT=".armv7-armhf" matrix: fast_finish: true + +before_install: + - docker info + - docker run --rm --privileged multiarch/qemu-user-static:register --reset +install: + - docker build --build-arg VCS_REF=$TRAVIS_COMMIT --build-arg BUILD_DATE=$(date +"%Y-%m-%dT%H:%M:%SZ") -t $DOCKER_REPO:$TRAVIS_BRANCH-$TARGET -f extra/Dockerfile${EXT} . + - docker run --rm $DOCKER_REPO:$TRAVIS_BRANCH-$TARGET uname -a +after_success: + - docker login -e=$DOCKER_EMAIL -u=$DOCKER_USERNAME -p=$DOCKER_PASSWORD + - docker push $DOCKER_REPO:$TRAVIS_BRANCH-$TARGET diff --git a/extra/Dockerfile b/extra/Dockerfile index e48cd40..e5b9e11 100644 --- a/extra/Dockerfile +++ b/extra/Dockerfile @@ -47,7 +47,7 @@ VOLUME /var/run/motion # Video & images VOLUME /var/lib/motioneye -ADD motioneye.conf.sample /usr/share/motioneye/extra/ +ADD extra/motioneye.conf.sample /usr/share/motioneye/extra/ CMD test -e /etc/motioneye/motioneye.conf || \ cp /usr/share/motioneye/extra/motioneye.conf.sample /etc/motioneye/motioneye.conf ; \ diff --git a/extra/Dockerfile.armv7-armhf b/extra/Dockerfile.armv7-armhf index fb711a6..3aaf61e 100644 --- a/extra/Dockerfile.armv7-armhf +++ b/extra/Dockerfile.armv7-armhf @@ -46,7 +46,7 @@ VOLUME /var/run/motion # Video & images VOLUME /var/lib/motioneye -ADD motioneye.conf.sample /usr/share/motioneye/extra/ +ADD extra/motioneye.conf.sample /usr/share/motioneye/extra/ CMD test -e /etc/motioneye/motioneye.conf || \ cp /usr/share/motioneye/extra/motioneye.conf.sample /etc/motioneye/motioneye.conf ; \ diff --git a/extra/Dockerfile.local b/extra/Dockerfile.local index 61218f1..3da5c67 100644 --- a/extra/Dockerfile.local +++ b/extra/Dockerfile.local @@ -1,62 +1,46 @@ +FROM ubuntu:17.10 +LABEL maintainer="Marcus Klein " + +ARG BUILD_DATE +ARG VCS_REF +LABEL org.label-schema.build-date=$BUILD_DATE \ + org.label-schema.docker.dockerfile="extra/Dockerfile" \ + org.label-schema.license="GPLv3" \ + org.label-schema.name="motioneye" \ + org.label-schema.url="https://github.com/ccrisan/motioneye/wiki" \ + org.label-schema.vcs-ref=$VCS_REF \ + org.label-schema.vcs-type="Git" \ + org.label-schema.vcs-url="https://github.com/ccrisan/motioneye.git" -FROM ubuntu:15.04 -MAINTAINER Conor Heine - -ENV DEBIAN_FRONTEND noninteractive - -RUN locale-gen en_US.UTF-8 -ENV LANGUAGE en_US.UTF-8 -ENV LC_ALL en_US.UTF-8 -ENV LANG en_US.UTF-8 -ENV LC_TYPE en_US.UTF-8 -ENV TZ America/Los_Angeles - -RUN apt-get update && \ - apt-get --yes install \ - automake \ - autoconf \ - build-essential \ - ffmpeg \ - git \ - libav-tools \ - libavcodec-dev \ - libavformat-dev \ - libavutil-dev \ - libcurl4-openssl-dev \ - libjpeg-dev \ - libssl-dev \ - libswscale-dev \ - pkgconf \ - python-dev \ - python-pip \ - python-setuptools \ - subversion \ - v4l-utils && \ - apt-get clean - -# Pip -RUN pip install tornado jinja2 pillow pycurl - -# Install motion -RUN cd /tmp && git clone --branch 4.0 https://github.com/Motion-Project/motion.git motion-project -RUN cd /tmp/motion-project && \ - autoreconf -fiv && \ - ./configure --prefix=/usr --without-pgsql --without-sqlite3 --without-mysql --with-ffmpeg=/usr && \ - make && \ - touch README \ - make install && \ - cp motion /usr/local/bin/motion && cd / && \ - rm -rf /tmp/motion-project - -# Install motioneye from local source COPY . /tmp/motioneye -RUN cd /tmp/motioneye && \ - python setup.py install && \ - mkdir /etc/motioneye && \ - mkdir -p /var/lib/motioneye && \ - mkdir -p /usr/share/motioneye/extra && \ - cp /tmp/motioneye/extra/motioneye.conf.sample /usr/share/motioneye/extra/motioneye.conf.sample && \ - rm -rf /tmp/motioneye + +RUN apt-get --quiet update && \ + DEBIAN_FRONTEND="noninteractive" apt-get --quiet --yes --option Dpkg::Options::="--force-confnew" --no-install-recommends install \ + curl \ + ffmpeg \ + libmysqlclient20 \ + libpq5 \ + lsb-release \ + python-jinja2 \ + python-pil \ + python-pip \ + python-pycurl \ + python-setuptools \ + python-tornado \ + python-wheel \ + v4l-utils && \ + curl -L --output /tmp/motion.deb https://github.com/Motion-Project/motion/releases/download/release-4.0.1/yakkety_motion_4.0.1-1_amd64.deb && \ + dpkg -i /tmp/motion.deb && \ + rm /tmp/motion.deb && \ + cd /tmp/motioneye && \ + pip install /tmp/motioneye && \ + rm -rf /tmp/motioneye && \ + apt-get purge --yes \ + python-pip \ + python-setuptools \ + python-wheel && \ + apt-get --quiet autoremove --yes && \ + apt-get --quiet --yes clean && rm -rf /var/lib/apt/lists/* && rm -f /var/cache/apt/*.bin # R/W needed for motioneye to update configurations VOLUME /etc/motioneye @@ -67,9 +51,10 @@ VOLUME /var/run/motion # Video & images VOLUME /var/lib/motioneye +ADD extra/motioneye.conf.sample /usr/share/motioneye/extra/ + CMD test -e /etc/motioneye/motioneye.conf || \ cp /usr/share/motioneye/extra/motioneye.conf.sample /etc/motioneye/motioneye.conf ; \ /usr/local/bin/meyectl startserver -c /etc/motioneye/motioneye.conf EXPOSE 8765 - -- 2.39.5