-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathDockerfile
90 lines (56 loc) · 3.33 KB
/
Dockerfile
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
FROM azul/zulu-openjdk-alpine:8-jre AS build
RUN apk add zip unzip curl
RUN mkdir /opt/box
RUN curl --location -o /opt/box/box https://s3.amazonaws.com/downloads.ortussolutions.com/ortussolutions/commandbox/6.1.0/box-light
RUN chmod -R a+rx /opt/box/box
RUN /opt/box/box config set verboseErrors=true
RUN /opt/box/box config set server.defaults.trayEnable=false
RUN /opt/box/box config set server.defaults.openBrowser=false
RUN /opt/box/box version
RUN java -version
RUN /opt/box/box artifacts clean --force
# Remove any temp files
RUN rm -rf /root/.CommandBox/temp/*
# Remove any log files
RUN rm -rf /root/.CommandBox/logs/*
# Remove compiled CFML to save space lucee will have to recompile
RUN rm -rf /root/.CommandBox/engine/cfml/cli/cfml-web/cfclasses/*
# Remove cachebox caches
RUN rm -rf /root/.CommandBox/cfml/system/mdCache/*
# Cleanup CommandBox files
RUN rm -rfv /root/.CommandBox/cfml/system/config/server-icons/*.*
# Remove the felix cache
RUN rm -rf /root/.CommandBox/engine/cfml/cli/lucee-server/felix-cache/*
RUN rm -rf /root/.CommandBox/engine/cfml/cli/lucee-server/context/logs/*
RUN rm -rf /root/.CommandBox/engine/cfml/cli/lucee-server/context/context/admin/*
# These jar files are extracted again at runtime
# Except compress extension is needed to extract other extensions
RUN cp /root/.CommandBox/engine/cfml/cli/lucee-server/bundles/compress.extension* /tmp/
RUN cp /root/.CommandBox/engine/cfml/cli/lucee-server/bundles/net.lingala.zip4j-* /tmp/
RUN rm -f /root/.CommandBox/engine/cfml/cli/lucee-server/bundles/*.jar
RUN cp /tmp/compress.extension* /root/.CommandBox/engine/cfml/cli/lucee-server/bundles/
RUN cp /tmp/net.lingala.zip4j-* /root/.CommandBox/engine/cfml/cli/lucee-server/bundles/
RUN rm -f /root/.CommandBox/engine/cfml/cli/cfml-web/context/lucee-applet.jar
RUN rm -f /root/.CommandBox/engine/cfml/cli/cfml-web/context/lucee-admin.lar
RUN rm -f /root/.CommandBox/engine/cfml/cli/cfml-web/context/lucee-doc.lar
RUN curl --location -o /opt/box/box-thin https://s3.amazonaws.com/downloads.ortussolutions.com/ortussolutions/commandbox/6.1.0/box-thin
RUN mv /opt/box/box-thin /opt/box/box
RUN zip -q --delete /root/.CommandBox/lib/runwar-*.jar "org/bouncycastle/*"
#pack200 to reduce file sizes
#skip jgit
RUN mv /root/.CommandBox/lib/org.eclipse.jgit* /tmp/
RUN find /root/.CommandBox/ -type f -name "*.jar" -exec sh -c '/usr/lib/jvm/default-jvm/bin/pack200 --strip-debug --repack "$0"' {} \;
RUN mv /tmp/org.eclipse.jgit* /root/.CommandBox/lib/
#RUN find /usr/lib/jvm/default-jvm/ -type f -name "*.jar" -exec sh -c '/usr/lib/jvm/default-jvm/bin/pack200 --strip-debug --repack "$0"' {} \;
RUN find /root/.CommandBox/engine/cfml/cli/lucee-server/patches/ -type f -name "*.lco" -exec sh -c 'cp "$0" "$0.jar"' {} \;
RUN find /root/.CommandBox/engine/cfml/cli/lucee-server/patches/ -type f -name "*.lco" -exec sh -c '/usr/lib/jvm/default-jvm/bin/pack200 --strip-debug --repack "$0" "$0.jar"' {} \;
RUN rm -f /root/.CommandBox/engine/cfml/cli/lucee-server/patches/*.jar
#remove lucee id
RUN rm -f /root/.CommandBox/engine/cfml/cli/lucee-server/context/id
RUN rm -f /root/.CommandBox/engine/cfml/cli/cfml-web/id
FROM azul/zulu-openjdk-alpine:8-jre
COPY --from=build /opt/box /opt/box
COPY --from=build /root/.CommandBox/ /root/.CommandBox/
RUN chmod a+x /opt/box/box
RUN ln -s /opt/box/box /usr/bin/box
COPY ./version.txt /etc/minibox-version