Skip to content

Commit

Permalink
refactor Dockerfile to reduce number of layers
Browse files Browse the repository at this point in the history
  • Loading branch information
rordi committed Mar 5, 2017
1 parent cd14550 commit e183ba6
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,17 @@ MAINTAINER Dietrich Rordorf <[email protected]>

USER root

# exit on error
RUN set -e

# install ruby dependencies
RUN apk add --no-cache ruby ruby-bigdecimal ruby-json libstdc++ sqlite-libs

# install mailcatcher
RUN apk add --no-cache --virtual .build-deps ruby-dev make g++ sqlite-dev
RUN gem install mailcatcher --no-ri --no-rdoc
# set exit on error flag, install ruby deps, build mailcatcher, remove buold deps
RUN set -e && \
apk add --no-cache ruby ruby-bigdecimal ruby-json libstdc++ sqlite-libs && \
apk add --no-cache --virtual .build-deps ruby-dev make g++ sqlite-dev && \
gem install mailcatcher --no-ri --no-rdoc && \
apk del .build-deps && \
rm -rf /tmp/* /var/tmp/*

# expose ports
EXPOSE 1025
EXPOSE 1080

# remove no longer needed packages
RUN apk del .build-deps
RUN rm -rf /tmp/* /var/tmp/*

# run process
# entrypoint: run mailcatcher process
CMD ["mailcatcher", "-f", "--ip=0.0.0.0"]

0 comments on commit e183ba6

Please sign in to comment.