Added a hack for upstart

This commit is contained in:
Kyle Johnson 2014-01-24 19:43:08 -05:00
parent 59e6ab86a0
commit df34010f2a
1 changed files with 21 additions and 14 deletions

View File

@ -1,7 +1,6 @@
# ZoneMinder # ZoneMinder
# #
# Version 0.0.1 # Version 0.0.1
# GOAL Ability to quickly stand up a ZoneMinder server in order to test code
FROM ubuntu FROM ubuntu
MAINTAINER Kyle Johnson <kjohnson@gnulnx.net> MAINTAINER Kyle Johnson <kjohnson@gnulnx.net>
@ -9,18 +8,17 @@ MAINTAINER Kyle Johnson <kjohnson@gnulnx.net>
# Let the conatiner know that there is no tty # Let the conatiner know that there is no tty
ENV DEBIAN_FRONTEND noninteractive ENV DEBIAN_FRONTEND noninteractive
# Hack for Upstart
RUN dpkg-divert --local --rename --add /sbin/initctl
RUN ln -s /bin/true /sbin/initctl
# Resynchronize the package index files # Resynchronize the package index files
RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list
RUN apt-get update RUN apt-get update
RUN apt-get upgrade -y
# Install the MySQL server # Install the prerequisites
RUN apt-get install -y mysql-server RUN apt-get install -y build-essential libmysqlclient-dev libssl-dev libbz2-dev libpcre3-dev libdbi-perl libarchive-zip-perl libdate-manip-perl libdevice-serialport-perl libmime-perl libpcre3 libwww-perl libdbd-mysql-perl libsys-mmap-perl yasm subversion automake autoconf libjpeg-turbo8-dev libjpeg-turbo8 libtheora-dev libvorbis-dev libvpx-dev libx264-dev libmp4v2-dev ffmpeg git wget mysql-server mysql-client apache2 php5 php5-mysql apache2-mpm-prefork libapache2-mod-php5 php5-cli
# Install apache and php
RUN apt-get install -y apache2 php5 php5-mysql apache2-mpm-prefork libapache2-mod-php5 php5-cli
# Install the prerequisites required to build ZoneMinder and ffmpeg
RUN apt-get install -y build-essential libmysqlclient-dev libssl-dev libbz2-dev libpcre3-dev libdbi-perl libarchive-zip-perl libdate-manip-perl libdevice-serialport-perl libmime-perl libpcre3 libwww-perl libdbd-mysql-perl libsys-mmap-perl yasm subversion automake autoconf libjpeg-turbo8-dev libjpeg-turbo8 libtheora-dev libvorbis-dev libvpx-dev libx264-dev libmp4v2-dev ffmpeg git wget
# Grab the latest ZoneMinder code # Grab the latest ZoneMinder code
RUN git clone https://github.com/ZoneMinder/ZoneMinder.git RUN git clone https://github.com/ZoneMinder/ZoneMinder.git
@ -28,11 +26,11 @@ RUN git clone https://github.com/ZoneMinder/ZoneMinder.git
# Change into the ZoneMinder directory # Change into the ZoneMinder directory
WORKDIR ZoneMinder WORKDIR ZoneMinder
# Grab the configure script from my puppet-zoneminder installer # Setup the ZoneMinder build environment
RUN wget https://raw.github.com/kylejohnson/puppet-zoneminder/master/templates/configure.sh.erb -O configure.sh RUN aclocal && autoheader && automake --force-missing --add-missing && autoconf
# Run configure # Configure ZoneMinder
RUN bash configure.sh RUN ./configure --with-libarch=lib/$DEB_HOST_GNU_TYPE --disable-debug --host=$DEB_HOST_GNU_TYPE --build=$DEB_BUILD_GNU_TYPE --with-mysql=/usr --with-webdir=/var/www/zm --with-ffmpeg=/usr --with-cgidir=/usr/lib/cgi-bin --with-webuser=www-data --with-webgroup=www-data --enable-crashtrace=no --enable-mmap=yes ZM_SSL_LIB=openssl ZM_DB_USER=zm ZM_DB_PASS=zm
# Build ZoneMinder # Build ZoneMinder
RUN make RUN make
@ -40,8 +38,17 @@ RUN make
# Install ZoneMinder # Install ZoneMinder
RUN make install RUN make install
# Start MySQL
RUN /usr/bin/mysqld_safe &
# Sleep, let MySQL start.
RUN sleep 10
# See if MySQL is running...
RUN ps ax | grep mysql
# Create the ZoneMinder database # Create the ZoneMinder database
RUN mysql -u root < db/zm_create.sql RUN mysql -u root -h localhost < db/zm_create.sql
# Create the ZoneMinder database user # Create the ZoneMinder database user
RUN mysql -u root -e "grant insert,select,update,delete on zm.* to 'zm'@'localhost' identified by 'zmpass'" RUN mysql -u root -e "grant insert,select,update,delete on zm.* to 'zm'@'localhost' identified by 'zmpass'"