Skip to content

Commit

Permalink
Add Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
amrabed committed Mar 14, 2017
1 parent 85b4faf commit 9fce96c
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 5 deletions.
20 changes: 20 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM java
LABEL maintainer "AmrAbed@vt.edu"

WORKDIR /tmp/rhids

COPY rhids /usr/bin/rhids
COPY src src
COPY gradle gradle
COPY build.gradle gradlew ./

RUN ./gradlew createJar && cp build/libs/*.jar /usr/bin/rhids/rhids.jar

ENV PATH $PATH:/usr/bin/rhids

VOLUME /usr/log/strace-docker
VOLUME /var/log/rhids

ENTRYPOINT ["rhids"]

CMD ["-h"]
3 changes: 0 additions & 3 deletions install
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ cd "$(dirname "$0")"

APP_NAME="rhids"

# Install strace-docker
git clone https://github.com/amrabed/strace-docker.git && ./strace-docker/install

# Install Java 8 (if not installed)
if ! type java > /dev/null; then
apt-get install -y software-properties-common
Expand Down
5 changes: 3 additions & 2 deletions rhids/rhids
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash

time=$(date +%Y%m%d%H%M%S)
cd "$(dirname "$0")" && sudo java -jar rhids.jar $@ | sudo tee /var/log/rhids/output-$time
[ $(id -u) -ne 0 ] && echo "RHIDS needs to run as root" && exit 1

cd "$(dirname "$0")" && java -jar rhids.jar $@ | tee /var/log/rhids/output-$(date +%Y%m%d%H%M%S)

0 comments on commit 9fce96c

Please sign in to comment.