-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add epicbox-java/11 image, rename epicbox-java9 -> epicbox-java/9
- Loading branch information
Showing
5 changed files
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.idea/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
FROM openjdk:11.0.1-slim | ||
MAINTAINER Stepik Team <[email protected]> | ||
|
||
COPY java_lookup_main.sh /usr/local/bin/java_lookup_main.sh | ||
RUN chmod +x /usr/local/bin/java_lookup_main.sh | ||
|
||
RUN useradd -M -d /sandbox sandbox |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
# Grep *.class files in the given directory to find one with psvm method defined | ||
# Usage: java_lookup_main.sh DIRECTORY_PATH | ||
|
||
PSVM_REGEX="public static( final)? void main\(java\.lang\.String(\[\]|\.\.\.)\)" | ||
|
||
shopt -s nullglob | ||
for f in "$1"/*.class; do | ||
if javap -p "$f" 2> /dev/null | grep -Pq "$PSVM_REGEX"; then | ||
filename=$(basename "$f") | ||
echo -n "${filename%.*}" | ||
exit 0 | ||
fi | ||
done | ||
exit 1 |