Commit 9106c081 authored by Ernesto Rodriguez Ortiz's avatar Ernesto Rodriguez Ortiz
Browse files

docker: Using phusion/baseimage instead ubuntu like base image

Read about reasons in https://registry.hub.docker.com/u/phusion/baseimage/
parent 291f70ed
......@@ -2,18 +2,25 @@
#
# VERSION 0.2
# DOCKER-VERSION 0.4
FROM ubuntu:trusty
FROM phusion/baseimage
MAINTAINER Ernesto Rodriguez Ortiz <ernesto.rodriguezortiz@savoirfairelinux.com>
# Set correct environment variables.
ENV HOME /root
# Regenerate SSH host keys. baseimage-docker does not contain any, so you
# have to do that yourself. You may also comment out this instruction; the
# init system will auto-generate one during boot.
RUN /etc/my_init.d/00_regen_ssh_host_keys.sh
# Use baseimage-docker's init system.
CMD ["/sbin/my_init"]
# Update software source
RUN apt-get update
RUN dpkg-divert --local --rename --add /sbin/initctl
RUN ln -sf /bin/true /sbin/initctl
# Install Apache, MySQL, PHP, and others..
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install vim curl wget git mysql-client mysql-server apache2 libapache2-mod-php5 pwgen python-setuptools vim-tiny php5-mysql php-apc php5-gd php5-curl php5-memcache memcached mc php-pear postfix php5-imagick php5-dev build-essential
RUN DEBIAN_FRONTEND=noninteractive apt-get autoclean
# Install drush, phpmd, phpcpd, site_audit, uploadprogress
RUN pear channel-discover pear.drush.org && pear install drush/drush
......@@ -27,7 +34,20 @@ RUN ln -s /etc/php5/mods-available/uploadprogress.ini /etc/php5/apache2/conf.d/2
# Make mysql listen on the outside
RUN sed -i "s/^bind-address/#bind-address/" /etc/mysql/my.cnf
COPY start-servers /usr/local/bin/
WORKDIR /var/www/html
# Adding additional memcached daemon
RUN mkdir /etc/service/memcached
ADD service/memcached.sh /etc/service/memcached/run
# Adding additional mysqld daemon
RUN mkdir /etc/service/apache2
ADD service/apache2.sh /etc/service/apache2/run
# Adding additional apache2 daemon
RUN mkdir /etc/service/mysqld
ADD service/mysqld.sh /etc/service/mysqld/run
# Expose port 80 for apache connection on the aoutside
EXPOSE 80
CMD ["start-servers"]
# Clean up APT when done.
RUN DEBIAN_FRONTEND=noninteractive apt-get autoclean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
#!/bin/bash
set -e
# Start nysql server
/usr/bin/mysqld_safe &
# Apache gets grumpy about PID files pre-existing
rm -f /var/run/apache2/apache2.pid
source /etc/apache2/envvars
......
#!/bin/sh
exec /sbin/setuser memcache /usr/bin/memcached
#!/bin/sh
exec /sbin/setuser mysql /usr/bin/mysqld_safe
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment