Skip to content

Commit

Permalink
Merge pull request #34 from bryanlatten/cleanup
Browse files Browse the repository at this point in the history
Dockerfile: +cleanup script for downstream containers
  • Loading branch information
Bryan Latten committed Jul 7, 2015
2 parents 61e1194 + b133348 commit f2f0ac1
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,16 @@ ONBUILD RUN rm -rf /var/www/html && ln -s /app/public /var/www/html

#####################################################################


# Packages in this parent container are provided for ease of integration
# in downstream (child) builds. Some dev-only packages need to be removed
# for a production system (git/wget/gcc/etc)

# TODO: script needs to be called AFTER downstream build is performed,
# ONBUILD instruction gets called BEFORE, so not useful
# RUN /bin/bash /clean.sh



EXPOSE 80
CMD ["/bin/bash", "/run.sh"]
12 changes: 12 additions & 0 deletions container/root/clean.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

# Perform cleanup, ensure unnecessary packages are removed
RUN apt-get remove -yq \
wget \
git \
php5-dev \
gcc && \
apt-get autoclean -y && \
apt-get autoremove -y && \
rm -rf /var/lib/{apt,dpkg,cache,log}/ && \
rm -rf /tmp/* /var/tmp/*

0 comments on commit f2f0ac1

Please sign in to comment.