From 48cc9a1964b452c60db7accd61d4006f15d6e5a8 Mon Sep 17 00:00:00 2001 From: Valerian Pereira Date: Sat, 2 Jun 2018 00:25:57 +0530 Subject: [PATCH] Image size improvement Docker image size improvement --- Dockerfile | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Dockerfile b/Dockerfile index af19649..71981eb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,12 @@ from ubuntu:14.04 -run echo 'deb http://us.archive.ubuntu.com/ubuntu/ trusty universe' >> /etc/apt/sources.list -run apt-get -y update +run echo 'deb http://us.archive.ubuntu.com/ubuntu/ trusty universe' >> /etc/apt/sources.list && \ + apt-get -y update # Install required packages -run apt-get -y install python-ldap python-cairo python-django python-twisted python-django-tagging python-simplejson python-memcache python-pysqlite2 python-support python-tz python-pip gunicorn supervisor nginx-light -run pip install whisper==0.9.15 -run pip install --install-option="--prefix=/var/lib/graphite" --install-option="--install-lib=/var/lib/graphite/lib" carbon==0.9.15 -run pip install --install-option="--prefix=/var/lib/graphite" --install-option="--install-lib=/var/lib/graphite/webapp" graphite-web==0.9.15 +run apt-get -y install python-ldap python-cairo python-django python-twisted python-django-tagging python-simplejson python-memcache python-pysqlite2 python-support python-tz python-pip gunicorn supervisor nginx-light && \ + pip install whisper==0.9.15 && \ + pip install --install-option="--prefix=/var/lib/graphite" --install-option="--install-lib=/var/lib/graphite/lib" carbon==0.9.15 && \ + pip install --install-option="--prefix=/var/lib/graphite" --install-option="--install-lib=/var/lib/graphite/webapp" graphite-web==0.9.15 # Add system service config add ./nginx.conf /etc/nginx/nginx.conf @@ -17,12 +17,12 @@ add ./initial_data.json /var/lib/graphite/webapp/graphite/initial_data.json add ./local_settings.py /var/lib/graphite/webapp/graphite/local_settings.py add ./carbon.conf /var/lib/graphite/conf/carbon.conf add ./storage-schemas.conf /var/lib/graphite/conf/storage-schemas.conf -run mkdir -p /var/lib/graphite/storage/whisper -run touch /var/lib/graphite/storage/graphite.db /var/lib/graphite/storage/index -run chown -R www-data /var/lib/graphite/storage -run chmod 0775 /var/lib/graphite/storage /var/lib/graphite/storage/whisper -run chmod 0664 /var/lib/graphite/storage/graphite.db -run cd /var/lib/graphite/webapp/graphite && python manage.py syncdb --noinput +run mkdir -p /var/lib/graphite/storage/whisper && \ + touch /var/lib/graphite/storage/graphite.db /var/lib/graphite/storage/index && \ + chown -R www-data /var/lib/graphite/storage && \ + chmod 0775 /var/lib/graphite/storage /var/lib/graphite/storage/whisper && \ + chmod 0664 /var/lib/graphite/storage/graphite.db && \ + cd /var/lib/graphite/webapp/graphite && python manage.py syncdb --noinput # Nginx expose 80