forked from docker-library/tomcat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfrom.jq
26 lines (25 loc) · 749 Bytes
/
from.jq
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# this file expects "env.variant" (but has no other dependency)
def java_dir:
env.variant | split("/")[0] # "jdk16", etc
;
def java_version:
java_dir | ltrimstr("jre") | ltrimstr("jdk") # "16", etc
;
def java_variant:
java_dir | rtrimstr(java_version) # "jdk", "jre"
;
def vendor_variant:
env.variant | split("/")[1] # "openjdk-slim-buster", etc
;
def from:
vendor_variant
| if test("^corretto-") then
"amazoncorretto:" + java_version + ltrimstr("corretto") + "-" + java_variant
elif test("^openjdk-") then
"openjdk:" + java_version + "-" + java_variant + ltrimstr("openjdk")
elif test("^temurin-") then
"eclipse-temurin:" + java_version + "-" + java_variant + ltrimstr("temurin")
else
error("unknown vendor variant: " + .)
end
;