Skip to content

Commit

Permalink
gauntlt in a docker
Browse files Browse the repository at this point in the history
  • Loading branch information
wickett committed Dec 1, 2015
1 parent 4160e5f commit d7353de
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 0 deletions.
25 changes: 25 additions & 0 deletions Dockerfile
@@ -0,0 +1,25 @@
FROM ubuntu:14.04
MAINTAINER james@gauntlt.org

# Install Ruby
RUN echo "deb http://ppa.launchpad.net/brightbox/ruby-ng/ubuntu trusty main" > /etc/apt/sources.list.d/ruby.list
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C3173AA6
RUN \
apt-get update && \
apt-get install -y build-essential \
ca-certificates \
curl \
wget \
zlib1g-dev \
libxml2-dev \
libxslt1-dev \
ruby2.0 \
ruby2.0-dev && \
rm -rf /var/lib/apt/lists/*

# Install Gauntlt
RUN gem install gauntlt --no-rdoc --no-ri

# Install Attack tools
RUN gem install arachni --no-rdoc --no-ri

15 changes: 15 additions & 0 deletions Makefile
@@ -0,0 +1,15 @@
all: help

build:
@./build-gauntlt.sh

clean:
@./docker-clean.sh

help:
@echo "the help menu"
@echo "make clean"
@echo "make build"
@echo "make help"

.PHONY: build clean
13 changes: 13 additions & 0 deletions build-gauntlt.sh
@@ -0,0 +1,13 @@
#!/bin/bash

set -e

function build() {
local TARGET=$1
if [ ! -d $TARGET ]; then
echo "** ERROR: $TARGET isn't a valid directory"
fi
docker build -t $TARGET .
}

build "gauntlt"
30 changes: 30 additions & 0 deletions docker-clean.sh
@@ -0,0 +1,30 @@
#!/usr/bin/env bash

function docker-cleanup {
EXITED=$(docker ps -aq -f status=exited)
DANGLING=$(docker images -q -f "dangling=true")

if [ "$1" == "--dry-run" ]; then
echo "==> Would stop containers:"
echo $EXITED
echo "==> And images:"
echo $DANGLING
else
if [ -n "$EXITED" ]; then
echo "Removing these containers:"
docker rm $EXITED
else
echo "No containers to remove."
fi
if [ -n "$DANGLING" ]; then
echo "Removing these images:"
docker rmi $DANGLING
else
echo "No images to remove."
fi
fi
}

# use --dry-run to see what would happen

docker-cleanup

0 comments on commit d7353de

Please sign in to comment.