metasploit-framework/docker/Dockerfile

57 lines
1.3 KiB
Docker
Raw Normal View History

FROM ruby:2.4.1-alpine
MAINTAINER Rapid7
2017-04-22 00:10:00 +00:00
ARG BUNDLER_ARGS="--jobs=8 --without development test coverage"
ENV APP_HOME /usr/src/metasploit-framework/
ENV MSF_USER msf
2017-05-17 15:18:58 +00:00
ENV NMAP_PRIVILEGED=""
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 \
nmap-scripts \
nmap-nselibs \
2017-04-22 00:10:00 +00:00
postgresql-libs \
ncurses \
libcap \
2017-04-22 00:10:00 +00:00
&& apk add --virtual .ruby-builddeps \
autoconf \
bison \
build-base \
ruby-dev \
libffi-dev\
openssl-dev \
readline-dev \
sqlite-dev \
postgresql-dev \
libpcap-dev \
libxml2-dev \
libxslt-dev \
yaml-dev \
zlib-dev \
ncurses-dev \
&& echo "gem: --no-ri --no-rdoc" > /etc/gemrc \
&& bundle install --system $BUNDLER_ARGS \
&& apk del .ruby-builddeps \
&& rm -rf /var/cache/apk/*
# fix for robots gem not readable (known bug)
# https://github.com/rapid7/metasploit-framework/issues/6068
RUN chmod o+r /usr/local/bundle/gems/robots-*/lib/robots.rb
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
USER $MSF_USER
ADD ./ $APP_HOME
CMD ["./msfconsole", "-r", "docker/msfconsole.rc"]