@@ -54,7 +54,7 @@ COPY openvoxserver/prep_build_container.sh /
5454RUN /prep_build_container.sh
5555
5656################################################################################
57- FROM base AS final
57+ FROM base AS app
5858
5959# renovate: datasource=rubygems depName=hiera-eyaml
6060ARG RUBYGEM_HIERA_EYAML=5.0.1
@@ -111,7 +111,7 @@ ENV AUTOSIGN=true \
111111 OPENVOXSERVER_GRAPHITE_HOST=exporter \
112112 OPENVOXSERVER_GRAPHITE_PORT=9109 \
113113 OPENVOXSERVER_HOSTNAME="" \
114- OPENVOXSERVER_JAVA_ARGS="-Xms1024m -Xmx1024m" \
114+ OPENVOXSERVER_JAVA_ARGS="-Xms1024m -Xmx1024m -XX:SharedArchiveFile=/opt/puppetlabs/server/apps/puppetserver/puppetserver.jsa " \
115115 OPENVOXSERVER_MAX_ACTIVE_INSTANCES=1 \
116116 OPENVOXSERVER_MAX_REQUESTS_PER_INSTANCE=0 \
117117 OPENVOXSERVER_PORT=8140 \
@@ -138,6 +138,14 @@ RUN /prep_release_container.sh
138138
139139USER puppet:0
140140
141+ # Create a CDS archive in a stage for faster class loading.
142+ FROM app AS cds
143+ RUN OPENVOXSERVER_JAVA_ARGS="-Xms1024m -Xmx1024m -XX:ArchiveClassesAtExit=/opt/puppetlabs/server/apps/puppetserver/puppetserver.jsa -Xlog:cds=off" \
144+ timeout --preserve-status 60 dumb-init /container-entrypoint.sh foreground || [ $? -eq 143 ]
145+
146+ FROM app AS final
147+ COPY --from=cds /opt/puppetlabs/server/apps/puppetserver/puppetserver.jsa /opt/puppetlabs/server/apps/puppetserver/puppetserver.jsa
148+
141149# k8s uses livenessProbe, startupProbe, readinessProbe and ignores HEALTHCHECK
142150HEALTHCHECK --interval=20s --timeout=15s --retries=12 --start-period=3m CMD ["/healthcheck.sh"]
143151
0 commit comments