File tree Expand file tree Collapse file tree
Open diff view settings
Expand file tree Collapse file tree
Open diff view settings
Original file line number Diff line number Diff line change 1010 <version >1.0</version >
1111
1212 <name >docker-java-app</name >
13- <url >http ://www. mkyong.com</url >
13+ <url >https ://mkyong.com/docker/docker-and-java-application-examples/ </url >
1414
1515 <properties >
1616 <project .build.sourceEncoding>UTF-8</project .build.sourceEncoding>
Original file line number Diff line number Diff line change 1- # Docker build steps
1+ ## What is it?
2+ This source code is an executable JAR file, using jsoup HTML parser to find all links from a URL.
3+
4+ Tested with
5+ * Docker 19.03
6+ * Ubuntu 19
7+ * Java 8
8+ * Maven
29
3- ## Build image
4- $ cd $project
5- $ sudo docker build -t docker-java:1.0 .
10+ For explanation, please visit this article - [ Docker and Java Application] ( https://mkyong.com/docker/docker-and-java-application-examples/ )
611
7- ## Build container and run it.
8- $ sudo docker run -t docker-java:1.0 https://google.com
12+ ## How to run this?
13+ ``` bash
14+ $ git clone https://github.com/mkyong/docker-java
15+ $ cd docker-java-app
16+ $ mvn package
17+ $ java -jar target/find-links.jar https://google.com
918
10- ## Access the docker image file system
11- # comment ENTRYPOINT to avoid container run the jar file during startup
12- # $ sudo docker run -it docker-java:1.0 /bin/sh
19+ //dockerize
20+ // create a docker image
21+ $ sudo docker build -t docker-java:1.0 .
22+ // run it
23+ $ sudo docker run -t docker-java:1.0 https://google.com
24+ ```
You can’t perform that action at this time.
0 commit comments