Commit b95b8d05 by Mariusz Kupidura Committed by GitHub

Refactor Dockerfile. (#326)

Add base layer with installing requirements to shorten build time.
Add .dockerignore to reduce amount of files to copy.
Remove unnecessary `run_docker.sh` script.
parent 1d37006f
.idea/
.travis/
README.md
LICENSE
.travis.yml
*.pyc
*.log
\ No newline at end of file
FROM python:2.7
WORKDIR /routersploit
COPY requirements.txt /tmp/requirements.txt
RUN pip install -r /tmp/requirements.txt
RUN git clone https://github.com/reverse-shell/routersploit/ .
RUN pip install -r requirements.txt
WORKDIR /routersploit
COPY . .
CMD ["python", "rsf.py"]
\ No newline at end of file
# Makefile that aggregates common chores before commit
.PHONY: all clean lint lint-modules test build update run help
.PHONY: build run test lint lint-modules clean prune help
MODULE=''
RSF_IMAGE=routersploit
all: lint test
build:
docker build -t $(RSF_IMAGE) .
clean:
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +
run:
docker run -it --rm $(RSF_IMAGE)
lint:
./run_linter.sh
......@@ -20,21 +18,25 @@ lint-modules:
test: clean
./run_tests.sh $(MODULE)
build:
docker build -t routersploit:latest -f Dockerfile .
update:
./run_docker.sh git pull
clean:
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +
run:
./run_docker.sh
prune:
docker images -q -f dangling=true | xargs docker rmi
docker ps -q -f status=exited | xargs docker rm
help:
@echo " clean"
@echo " Remove python artifacts."
@echo " run"
@echo " Run Routersploit in docker container"
@echo " lint"
@echo " Check style with flake8."
@echo " lint-modules"
@echo " Check modules style with flake8."
@echo " test"
@echo " Run test suite"
@echo " clean"
@echo " Remove python artifacts."
@echo " prune"
@echo " Remove dangling docker images and exited containers."
#!/usr/bin/env bash
if [ -z $1 ] ; then
docker run -it --net host --rm routersploit
else
docker run -it --net host --rm routersploit $@
fi
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment