diff --git a/Dockerfile b/Dockerfile index 40f759a5b..27b5bc636 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ # ZoneMinder -FROM ubuntu:trusty -MAINTAINER Kyle Johnson +FROM ubuntu:xenial +MAINTAINER Markos Vakondios # Resynchronize the package index files RUN apt-get update && \ @@ -10,8 +10,8 @@ RUN apt-get update && \ libdbi-perl libarchive-zip-perl libdate-manip-perl libdevice-serialport-perl libmime-perl libpcre3 \ libwww-perl libdbd-mysql-perl libsys-mmap-perl yasm cmake libjpeg-turbo8-dev \ libjpeg-turbo8 libtheora-dev libvorbis-dev libvpx-dev libx264-dev libmp4v2-dev libav-tools mysql-client \ - apache2 php5 php5-mysql apache2-mpm-prefork libapache2-mod-php5 php5-cli \ - mysql-server libvlc-dev libvlc5 libvlccore-dev libvlccore7 vlc-data libcurl4-openssl-dev \ + apache2 php php-mysql libapache2-mod-php php-cli \ + mysql-server libvlc-dev libvlc5 libvlccore-dev libvlccore8 vlc-data libcurl4-openssl-dev \ libavformat-dev libswscale-dev libavutil-dev libavcodec-dev libavfilter-dev \ libavresample-dev libavdevice-dev libpostproc-dev libv4l-dev libtool libnetpbm10-dev \ libmime-lite-perl dh-autoreconf dpatch \ @@ -46,7 +46,7 @@ RUN chown -R www-data:www-data /usr/local/share/zoneminder/ RUN cp misc/apache.conf /etc/apache2/sites-available/000-default.conf ADD utils/docker/phpdate.ini /etc/php5/apache2/conf.d/25-phpdate.ini -# Expose http ports +# Expose http port EXPOSE 80 # Initial database and apache setup: diff --git a/utils/docker/setup.sh b/utils/docker/setup.sh index c7b8b121b..2cef688ff 100755 --- a/utils/docker/setup.sh +++ b/utils/docker/setup.sh @@ -1,7 +1,9 @@ #!/bin/bash # Start MySQL -/usr/bin/mysqld_safe & +test -e /var/run/mysqld || install -m 755 -o mysql -g root -d /var/run/mysqld +su - mysql -s /bin/sh -c "/usr/bin/mysqld_safe > /dev/null 2>&1 &" + # Give MySQL time to wake up SECONDS_LEFT=120 diff --git a/utils/docker/start.sh b/utils/docker/start.sh index 29cb2f567..86247e734 100755 --- a/utils/docker/start.sh +++ b/utils/docker/start.sh @@ -7,7 +7,8 @@ umount /dev/shm mount -t tmpfs -o rw,nosuid,nodev,noexec,relatime,size=512M tmpfs /dev/shm # Start MySQL -/usr/bin/mysqld_safe & +test -e /var/run/mysqld || install -m 755 -o mysql -g root -d /var/run/mysqld +su - mysql -s /bin/sh -c "/usr/bin/mysqld_safe > /dev/null 2>&1 &" # Ensure we shut down mysql cleanly later: trap close_mysql SIGTERM