NoIssue: A lot of cleanup and generalizations
This commit is contained in:
42
src/main/docker/Dockerfile_template
Normal file
42
src/main/docker/Dockerfile_template
Normal file
@@ -0,0 +1,42 @@
|
||||
FROM dockerreg.r35157.com/r35157/jre:_JREVERSION__amd64
|
||||
|
||||
LABEL maintainer="Minimons <minimons@r35157.com>"
|
||||
|
||||
# Setup environment
|
||||
ENV APP_HOME=/usr/local/software/nenjimkicker
|
||||
WORKDIR /usr/local/software
|
||||
USER root
|
||||
|
||||
RUN mkdir nenjimkicker-_VERSION_ \
|
||||
&& ln -s nenjimkicker-_VERSION_ nenjimkicker
|
||||
WORKDIR nenjimkicker
|
||||
RUN mkdir libs
|
||||
|
||||
# These dirs are expected to be overshadowed by host mounts
|
||||
RUN mkdir conf logs
|
||||
|
||||
# Set timezone
|
||||
ENV TZ=Europe/Copenhagen
|
||||
RUN apt-get update
|
||||
RUN apt-get install -y tzdata \
|
||||
&& ln -snf /usr/share/zoneinfo/$TZ /etc/localtime \
|
||||
&& echo $TZ > /etc/timezone \
|
||||
&& dpkg-reconfigure -f noninteractive tzdata
|
||||
|
||||
# Clean-up
|
||||
RUN apt-get autoremove -y \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install application and configuration (Do this as late as possible to be able to reuse layers between builds)
|
||||
COPY start.sh .
|
||||
COPY conf/* conf/
|
||||
COPY libs/*.jar libs/
|
||||
|
||||
RUN chmod 755 ./start.sh \
|
||||
&& chmod -R a+rX /usr/local/software/nenjimkicker-_VERSION_
|
||||
|
||||
USER user:user
|
||||
|
||||
CMD ["./start.sh"]
|
||||
|
||||
9
src/main/docker/publish_template.sh
Normal file
9
src/main/docker/publish_template.sh
Normal file
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
echo "Publishing '_HASHTAG_', '_VERSIONTAG_' and '_LATESTTAG_'..."
|
||||
docker push _HASHTAG_
|
||||
docker push _VERSIONTAG_
|
||||
docker push _LATESTTAG_
|
||||
|
||||
echo "Publishing completed!"
|
||||
17
src/main/docker/start.sh
Executable file
17
src/main/docker/start.sh
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
shopt -s nullglob
|
||||
|
||||
jars=(libs/*.jar)
|
||||
if (( ${#jars[@]} == 0 )); then
|
||||
echo "ERROR: No JARs found in libs/" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
CLASSPATH=$(IFS=:; echo "${jars[*]}")
|
||||
|
||||
exec java \
|
||||
-Dlog4j.configurationFile=/usr/local/software/nenjimkicker/conf/log4j2.xml \
|
||||
-cp "$CLASSPATH" \
|
||||
com.r35157.nenjim.kicker.impl.ref.Main
|
||||
Reference in New Issue
Block a user