2017-09-24 01:08:12 +00:00
|
|
|
FROM ruby:2.4.2-alpine
|
2016-07-18 18:38:57 +00:00
|
|
|
MAINTAINER Rapid7
|
|
|
|
|
2017-04-22 00:10:00 +00:00
|
|
|
ARG BUNDLER_ARGS="--jobs=8 --without development test coverage"
|
2016-07-18 18:38:57 +00:00
|
|
|
ENV APP_HOME /usr/src/metasploit-framework/
|
2017-04-27 08:36:56 +00:00
|
|
|
ENV MSF_USER msf
|
2017-05-17 15:18:58 +00:00
|
|
|
ENV NMAP_PRIVILEGED=""
|
2016-07-18 18:38:57 +00:00
|
|
|
WORKDIR $APP_HOME
|
|
|
|
|
|
|
|
COPY Gemfile* m* Rakefile $APP_HOME
|
|
|
|
COPY lib $APP_HOME/lib
|
|
|
|
|
|
|
|
RUN apk update && \
|
2017-04-22 00:10:00 +00:00
|
|
|
apk add \
|
|
|
|
sqlite-libs \
|
|
|
|
nmap \
|
2017-05-18 09:54:53 +00:00
|
|
|
nmap-scripts \
|
|
|
|
nmap-nselibs \
|
2017-04-22 00:10:00 +00:00
|
|
|
postgresql-libs \
|
|
|
|
ncurses \
|
2017-04-27 08:36:56 +00:00
|
|
|
libcap \
|
2017-04-22 00:10:00 +00:00
|
|
|
&& apk add --virtual .ruby-builddeps \
|
|
|
|
autoconf \
|
|
|
|
bison \
|
|
|
|
build-base \
|
|
|
|
ruby-dev \
|
|
|
|
openssl-dev \
|
|
|
|
readline-dev \
|
|
|
|
sqlite-dev \
|
|
|
|
postgresql-dev \
|
|
|
|
libpcap-dev \
|
|
|
|
libxml2-dev \
|
|
|
|
libxslt-dev \
|
|
|
|
yaml-dev \
|
|
|
|
zlib-dev \
|
|
|
|
ncurses-dev \
|
2017-07-17 14:41:47 +00:00
|
|
|
git \
|
2017-04-22 00:10:00 +00:00
|
|
|
&& echo "gem: --no-ri --no-rdoc" > /etc/gemrc \
|
2017-11-06 06:49:10 +00:00
|
|
|
# this currently fails: https://github.com/rubygems/rubygems/issues/2064
|
|
|
|
# && gem update --system \
|
2017-08-09 13:34:23 +00:00
|
|
|
&& gem install bundler \
|
2017-04-22 00:10:00 +00:00
|
|
|
&& bundle install --system $BUNDLER_ARGS \
|
|
|
|
&& apk del .ruby-builddeps \
|
|
|
|
&& rm -rf /var/cache/apk/*
|
2016-07-18 18:38:57 +00:00
|
|
|
|
2017-04-27 08:36:56 +00:00
|
|
|
RUN adduser -g msfconsole -D $MSF_USER
|
|
|
|
|
2017-04-27 08:55:03 +00:00
|
|
|
RUN /usr/sbin/setcap cap_net_raw,cap_net_bind_service=+eip $(which ruby)
|
2017-05-17 14:17:30 +00:00
|
|
|
RUN /usr/sbin/setcap cap_net_raw,cap_net_bind_service=+eip /usr/bin/nmap
|
2017-04-27 08:55:03 +00:00
|
|
|
|
2017-04-27 08:36:56 +00:00
|
|
|
USER $MSF_USER
|
|
|
|
|
2016-07-18 18:38:57 +00:00
|
|
|
ADD ./ $APP_HOME
|
2017-04-27 08:36:56 +00:00
|
|
|
|
2016-07-18 18:38:57 +00:00
|
|
|
CMD ["./msfconsole", "-r", "docker/msfconsole.rc"]
|