Skip to content

Commit c9eea91

Browse files
committed
Simple Dockerfile to run the insecure-bank application
1 parent 632b7cf commit c9eea91

File tree

2 files changed

+34
-2
lines changed

2 files changed

+34
-2
lines changed

Dockerfile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
FROM tomcat:8.0-jre8
2+
MAINTAINER Hdiv Security
3+
4+
# Copy the application to tomcat
5+
ADD target/insecure-bank.war /usr/local/tomcat/webapps
6+
7+
# Copy the license file
8+
ADD license.hdiv /usr/local/tomcat/hdiv/
9+
10+
# Copy the agent jar
11+
ADD hdiv-ee-agent.jar /usr/local/tomcat/hdiv/
12+
13+
# Run Tomcat and enjoy!
14+
CMD export JAVA_OPTS="-javaagent:hdiv/hdiv-ee-agent.jar \
15+
-Dhdiv.config.dir=hdiv/ \
16+
-Dhdiv.console.url=http://console:8080/hdiv-console-services \
17+
-Dhdiv.console.token=04db250da579302ca273a958 \
18+
-Dhdiv.server.name=Testing-Docker \
19+
-Dhdiv.toolbar.enabled=true" && catalina.sh run

README.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,26 @@
55
1. Clone the repository:
66

77
$ git clone https://github.com/hdiv/insecure-bank.git
8+
89
2. Run the application using an embedded Tomcat:
910

1011
$ mvn clean package
1112
$ mvn cargo:run
1213
1314
3. You can then access the bank application here: http://localhost:8080/insecure-bank/
1415

16+
## Running with Docker
17+
18+
Run the insecure-bank application with Docker.
19+
20+
Place Hdiv agent and license in the application root folder.
21+
22+
$ docker build -t insecure-bank .
23+
$ docker run -p 8080:8080 -d --name insecure-bank-app insecure-bank
24+
$ docker logs insecure-bank-app
25+
26+
Open the application in > http://localhost:8080/insecure-bank
27+
1528
## Login credentials
16-
- username: john
17-
- password: test
29+
- Username: john
30+
- Password: test

0 commit comments

Comments
 (0)