Skip to content

Commit e183ba6

Browse files
committed
refactor Dockerfile to reduce number of layers
1 parent cd14550 commit e183ba6

File tree

1 file changed

+8
-14
lines changed

1 file changed

+8
-14
lines changed

Dockerfile

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,17 @@ MAINTAINER Dietrich Rordorf <[email protected]>
44

55
USER root
66

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

1715
# expose ports
1816
EXPOSE 1025
1917
EXPOSE 1080
2018

21-
# remove no longer needed packages
22-
RUN apk del .build-deps
23-
RUN rm -rf /tmp/* /var/tmp/*
24-
25-
# run process
19+
# entrypoint: run mailcatcher process
2620
CMD ["mailcatcher", "-f", "--ip=0.0.0.0"]

0 commit comments

Comments
 (0)