赞
踩
RUN apt-get -y update
更新应该在上面,因为它需要更长时间来运行,也可以与你所有的镜像共享。
FROM ubuntu:trusty MAINTAINER Paul Czarkowski "paul@paulcz.net" RUN apt-get -yq update # Apache RUN \ apt-get -yqq install \ apache2 \ apache2-utils \ libapache2-mod-python \ python-dev \ python-pip \ python-cairo \ python-pysqlite2 \ python-mysqldb \ python-jinja2 sqlite3 \ curl \ wget \ git \ software-properties-common RUN \ curl -sSL https://bootstrap.pypa.io/get-pip.py | python && \ pip install whisper \ carbon \ graphite-web \ 'Twisted<12.0' \ 'django<1.6' \ django-tagging # Add start scripts etc ADD . /app RUN mkdir -p /app/wsgi RUN useradd -d /app -c 'application' -s '/bin/false' graphite RUN chmod +x /app/bin/* RUN chown -R graphite:graphite /app RUN chown -R graphite:graphite /opt/graphite RUN rm -f /etc/apache2/sites-enabled/* ADD ./apache-graphite.conf /etc/apache2/sites-enabled/apache-graphite.conf # Expose ports. EXPOSE 80 EXPOSE 2003 EXPOSE 2004 EXPOSE 7002 ENV APACHE_CONFDIR /etc/apache2 ENV APACHE_ENVVARS $APACHE_CONFDIR/envvars ENV APACHE_RUN_USER www-data ENV APACHE_RUN_GROUP www-data ENV APACHE_RUN_DIR /var/run/apache2 ENV APACHE_PID_FILE $APACHE_RUN_DIR/apache2.pid ENV APACHE_LOCK_DIR /var/lock/apache2 ENV APACHE_LOG_DIR /var/log/apache2 WORKDIR /app # Define default command. CMD ["/app/bin/start_graphite"]
# 1 - Common Header / Packages FROM ubuntu:trusty MAINTAINER Paul Czarkowski "paul@paulcz.net" RUN apt-get -yq update \ && apt-get -yqq install \ wget \ curl \ git \ software-properties-common # 2 - Python RUN \ apt-get -yqq install \ python-dev \ python-pip \ python-pysqlite2 \ python-mysqldb # 3 - Apache RUN \ apt-get -yqq install \ apache2 \ apache2-utils # 4 - Apache ENVs ENV APACHE_CONFDIR /etc/apache2 ENV APACHE_ENVVARS $APACHE_CONFDIR/envvars ENV APACHE_RUN_USER www-data ENV APACHE_RUN_GROUP www-data ENV APACHE_RUN_DIR /var/run/apache2 ENV APACHE_PID_FILE $APACHE_RUN_DIR/apache2.pid ENV APACHE_LOCK_DIR /var/lock/apache2 ENV APACHE_LOG_DIR /var/log/apache2 # 5 - Graphite and Deps RUN \ apt-get -yqq install \ libapache2-mod-python \ python-cairo \ python-jinja2 \ sqlite3 RUN \ pip install whisper \ carbon \ graphite-web \ 'Twisted<12.0' \ 'django<1.6' \ django-tagging # 6 - Other EXPOSE 80 2003 2004 7002 WORKDIR /app VOLUME /opt/graphite/data # Define default command. CMD ["/app/bin/start_graphite"] # 7 - First use of ADD ADD . /app # 8 - Final setup RUN mkdir -p /app/wsgi \ && useradd -d /app -c 'application' -s '/bin/false' graphite \ && chmod +x /app/bin/* \ && chown -R graphite:graphite /app \ && chown -R graphite:graphite /opt/graphite \ && rm -f /etc/apache2/sites-enabled/* \ && mv /app/apache-graphite.conf /etc/apache2/sites-enabled/apache-graphite.conf
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。