more docker work

bug/bundler_fix
Christian Mehlmauer 2017-04-22 02:10:00 +02:00
parent 89e81253ed
commit af003b28d1
No known key found for this signature in database
GPG Key ID: DCF54A05D6E62591
5 changed files with 54 additions and 40 deletions

View File

@ -5,6 +5,10 @@ docker-compose*.yml
docker/
!docker/msfconsole.rc
README.md
.git/
.github/
.ruby-version
.ruby-gemset
.bundle
Gemfile.local
@ -93,3 +97,6 @@ data/meterpreter/ext_server_pivot.*.dll
# https://rapid7.github.io/metasploit-framework. It's an orphan branch.
/metakitty
.vagrant
# no need for rspecs
spec/

View File

@ -16,12 +16,15 @@ rvm:
- '2.4.1'
env:
- RAKE_TASKS="cucumber cucumber:boot" CREATE_BINSTUBS=true
- RAKE_TASKS=spec SPEC_OPTS="--tag content"
- RAKE_TASKS=spec SPEC_OPTS="--tag ~content"
- CMD=bundle exec rake "cucumber cucumber:boot" CREATE_BINSTUBS=true
- CMD=bundle exec rake spec SPEC_OPTS="--tag content"
- CMD=bundle exec rake spec SPEC_OPTS="--tag ~content"
matrix:
fast_finish: true
include:
- rvm: ruby-head
env: CMD=docker-compose -f $TRAVIS_BUILD_DIR/docker-compose.yml build
before_install:
- "echo 'gem: --no-ri --no-rdoc' > ~/.gemrc"
- rake --version
@ -36,7 +39,7 @@ before_script:
- bundle exec rake db:migrate
script:
# fail build if db/schema.rb update is not committed
- git diff --exit-code db/schema.rb && bundle exec rake $RAKE_TASKS
- git diff --exit-code db/schema.rb && $CMD
notifications:
irc: "irc.freenode.org#msfnotify"
@ -49,3 +52,6 @@ branches:
except:
- gh-pages
- metakitty
services:
- docker

View File

@ -1,6 +1,6 @@
version: '2'
services:
ms: &ms
ms:
image: metasploit
build:
context: .

View File

@ -1,7 +1,7 @@
FROM ruby:2.3-alpine
MAINTAINER Rapid7
ARG BUNDLER_ARGS="--system --jobs=8"
ARG BUNDLER_ARGS="--jobs=8 --without development test coverage"
ENV APP_HOME /usr/src/metasploit-framework/
WORKDIR $APP_HOME
@ -9,39 +9,36 @@ COPY Gemfile* m* Rakefile $APP_HOME
COPY lib $APP_HOME/lib
RUN apk update && \
apk add \
ruby-bigdecimal \
ruby-bundler \
ruby-io-console \
autoconf \
bison \
subversion \
git \
sqlite \
nmap \
libxslt \
postgresql \
ncurses \
&& apk add --virtual .ruby-builddeps \
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 \
bison \
autoconf \
&& echo "gem: --no-ri --no-rdoc" > /etc/gemrc \
&& bundle install $BUNDLER_ARGS \
&& apk del .ruby-builddeps \
&& rm -rf /var/cache/apk/*
apk add \
sqlite-libs \
nmap \
# libxslt \
postgresql-libs \
# needed as long as metasploit-framework.gemspec contains a 'git ls'
git \
ncurses \
&& 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 \
bison \
autoconf \
&& echo "gem: --no-ri --no-rdoc" > /etc/gemrc \
&& bundle install --system $BUNDLER_ARGS \
&& apk del .ruby-builddeps \
&& rm -rf /var/cache/apk/*
ADD ./ $APP_HOME
CMD ["./msfconsole", "-r", "docker/msfconsole.rc"]

View File

@ -1,7 +1,11 @@
version: '2'
services:
ms: &ms
ms:
build:
args:
BUNDLER_ARGS: --jobs=8
image: metasploit:dev
environment:
DATABASE_URL: postgres://postgres@db:5432/msf_dev