From c03924f6a66ffc652d47e08eeac02cdf2e0fd314 Mon Sep 17 00:00:00 2001 From: Rik Veenboer Date: Sat, 27 Dec 2014 12:42:43 +0100 Subject: [PATCH] Add some Dockerfiles awaiting transformation to make approach --- images/base/Dockerfile | 25 +++++++++++++++++++++++ images/firefox/Dockerfile | 5 +++++ images/lighttpd/Dockerfile | 41 ++++++++++++++++++++++++++++++++++++++ images/mysql/Dockerfile | 25 +++++++++++++++++++++++ images/redis/Dockerfile | 33 ++++++++++++++++++++++++++++++ 5 files changed, 129 insertions(+) create mode 100644 images/base/Dockerfile create mode 100644 images/firefox/Dockerfile create mode 100644 images/lighttpd/Dockerfile create mode 100644 images/mysql/Dockerfile create mode 100644 images/redis/Dockerfile diff --git a/images/base/Dockerfile b/images/base/Dockerfile new file mode 100644 index 0000000..447f28b --- /dev/null +++ b/images/base/Dockerfile @@ -0,0 +1,25 @@ +FROM ubuntu:trusty +ENV MODE minimal +ENV HOST_ADDR 10.0.2.15 +ENV HOST_PORT 8001 +RUN apt-get install -y wget +RUN wget -q -P /build $HOST_ADDR:$HOST_PORT/config +RUN wget -q -P /build $HOST_ADDR:$HOST_PORT/init +RUN wget -q -O - $HOST_ADDR:$HOST_PORT/scripts/prepare.sh | bash +RUN wget -q -O - $HOST_ADDR:$HOST_PORT/scripts/cron.sh | bash +RUN mkdir -p /etc/service/cron +RUN wget -q -O /etc/service/cron/run $HOST_ADDR:$HOST_PORT/runit/cron +RUN wget -q -O - $HOST_ADDR:$HOST_PORT/scripts/syslog.sh | bash +RUN mkdir -p /etc/service/syslog +RUN wget -q -O /etc/service/syslog/run $HOST_ADDR:$HOST_PORT/runit/syslog +RUN wget -q -O - $HOST_ADDR:$HOST_PORT/scripts/sshd.sh | bash +RUN mkdir -p /etc/service/sshd +RUN wget -q -O /etc/service/sshd/run $HOST_ADDR:$HOST_PORT/runit/sshd +RUN wget -q -O - $HOST_ADDR:$HOST_PORT/scripts/hosts.sh | bash +RUN wget -q -O /opt/init.d/01_hosts $HOST_ADDR:$HOST_PORT/boot/hosts.sh +RUN wget -q -O - $HOST_ADDR:$HOST_PORT/scripts/init.sh | bash +RUN wget -q -O - $HOST_ADDR:$HOST_PORT/scripts/runit.sh | bash +RUN wget -q -O - $HOST_ADDR:$HOST_PORT/scripts/logrotate.sh | bash +RUN wget -q -O - $HOST_ADDR:$HOST_PORT/scripts/utilities.sh | bash +RUN wget -q -O - $HOST_ADDR:$HOST_PORT/scripts/cleanup.sh | bash +CMD ["/opt/init"] diff --git a/images/firefox/Dockerfile b/images/firefox/Dockerfile new file mode 100644 index 0000000..7cbfb1b --- /dev/null +++ b/images/firefox/Dockerfile @@ -0,0 +1,5 @@ +FROM ubuntu:precise + +ADD build /build + +RUN for s in /build/scripts/*.sh; do [ -x $s ] && $s || : ; done \ No newline at end of file diff --git a/images/lighttpd/Dockerfile b/images/lighttpd/Dockerfile new file mode 100644 index 0000000..cddd56d --- /dev/null +++ b/images/lighttpd/Dockerfile @@ -0,0 +1,41 @@ +FROM ubuntu:precise + +RUN apt-get update +RUN apt-get install -y wget gcc make + +RUN wget http://ftp.us.debian.org/debian/pool/main/l/linux/linux-libc-dev_3.2.54-2_amd64.deb +RUN dpkg -i linux-libc-dev_3.2.54-2_amd64.deb + +RUN apt-get install -y libxml2-dev libcurl4-openssl-dev libbz2-dev libjpeg-dev libpng12-dev libmcrypt-dev + +ENV PHP_VERSION 5.5.9 + +RUN cd /opt && \ + wget http://uk1.php.net/get/php-$PHP_VERSION.tar.gz/from/this/mirror -O php-$PHP_VERSION.tar.gz && \ + tar xzf php-$PHP_VERSION.tar.gz && \ + cd php-$PHP_VERSION && \ + ./configure --enable-calendar --enable-bcmath --with-bz2 --enable-ctype --without-gdbm --with-iconv --enable-exif --enable-ftp --with-gettext --enable-mbstring --enable-sockets --with-zlib --enable-soap --enable-zip --with-mhash --with-curl --with-gd --with-mysql --with-jpeg-dir --with-openssl --with-mysqli --with-mcrypt && \ + make && \ + make install + +#RUN chmod +x /opt/redis-$PHP_VERSION/src/redis-server + +#ENV REDIS_CONFIG /etc/redis/redis-server.conf +#ENV REDIS_LOG /host/var/log/redis/redis-server.log +#ENV REDIS_DATA /host/var/lib/redis + +#RUN mkdir -p `dirname $REDIS_CONFIG` +#RUN cp /opt/redis-$PHP_VERSION/redis.conf $REDIS_CONFIG +#RUN sed -i "s,^\(logfile\s*\).*$,\1$REDIS_LOG," $REDIS_CONFIG +#RUN sed -i "s,^\(dir\s*\).*$,\1$REDIS_DATA," $REDIS_CONFIG + +VOLUME [ "/host" ] +#EXPOSE 80 + +ENV LD_LIBRARY_PATH /root/lib +RUN mkdir $LD_LIBRARY_PATH +RUN cp /lib/x86_64-linux-gnu/libnss_files.so.2 $LD_LIBRARY_PATH +RUN perl -pi -e 's:/etc/hosts:/tmp/hosts:g' $LD_LIBRARY_PATH/libnss_files.so.2 + +#CMD /host/bin/run +CMD top \ No newline at end of file diff --git a/images/mysql/Dockerfile b/images/mysql/Dockerfile new file mode 100644 index 0000000..76d7338 --- /dev/null +++ b/images/mysql/Dockerfile @@ -0,0 +1,25 @@ +FROM ubuntu:precise + +RUN apt-get update +RUN apt-get install -y mysql-server + +ENV VERSION stable + +#RUN chmod +x /opt/redis-$VERSION/src/redis-server + +ENV MYSQL_CONFIG /etc/mysql/my.cnf +ENV MYSQL_LOG /host/var/log/mysql/error.log +ENV MYSQL_DATA /host/var/lib/mysql + +RUN sed -i "s,^\(log_error\s*=\s*\).*$,\1$MYSQL_LOG," $MYSQL_CONFIG +RUN sed -i "s,^\(datadir\s*=\s*\).*$,\1$MYSQL_DATA," $MYSQL_CONFIG + +VOLUME [ "/host" ] +EXPOSE 3306 + +ENV LD_LIBRARY_PATH /root/lib +RUN mkdir $LD_LIBRARY_PATH +RUN cp /lib/x86_64-linux-gnu/libnss_files.so.2 $LD_LIBRARY_PATH +RUN perl -pi -e 's:/etc/hosts:/tmp/hosts:g' $LD_LIBRARY_PATH/libnss_files.so.2 + +CMD /host/bin/run \ No newline at end of file diff --git a/images/redis/Dockerfile b/images/redis/Dockerfile new file mode 100644 index 0000000..5d90000 --- /dev/null +++ b/images/redis/Dockerfile @@ -0,0 +1,33 @@ +FROM ubuntu:precise + +RUN apt-get update +RUN apt-get install -y wget gcc make + +ENV REDIS_VERSION stable + +RUN cd /opt && \ + wget http://download.redis.io/releases/redis-$REDIS_VERSION.tar.gz && \ + tar xzf redis-$REDIS_VERSION.tar.gz && \ + cd redis-$REDIS_VERSION && \ + make + +RUN chmod +x /opt/redis-$REDIS_VERSION/src/redis-server + +ENV REDIS_CONFIG /etc/redis/redis-server.conf +ENV REDIS_LOG /host/var/log/redis/redis-server.log +ENV REDIS_DATA /host/var/lib/redis + +RUN mkdir -p `dirname $REDIS_CONFIG` +RUN cp /opt/redis-$REDIS_VERSION/redis.conf $REDIS_CONFIG +RUN sed -i "s,^\(logfile\s*\).*$,\1$REDIS_LOG," $REDIS_CONFIG +RUN sed -i "s,^\(dir\s*\).*$,\1$REDIS_DATA," $REDIS_CONFIG + +VOLUME [ "/host" ] +EXPOSE 6379 + +ENV LD_LIBRARY_PATH /root/lib +RUN mkdir $LD_LIBRARY_PATH +RUN cp /lib/x86_64-linux-gnu/libnss_files.so.2 $LD_LIBRARY_PATH +RUN perl -pi -e 's:/etc/hosts:/tmp/hosts:g' $LD_LIBRARY_PATH/libnss_files.so.2 + +CMD /host/bin/run \ No newline at end of file