Skip to content

Commit

Permalink
updates:
Browse files Browse the repository at this point in the history
- tomcat to version 9.0.56
- jolokia to version 1.7.1
- hawtio to version 2.14.1

rebuild Dockerfile
  • Loading branch information
bodsch committed Dec 12, 2021
1 parent f71efad commit a1bb470
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 26 deletions.
81 changes: 60 additions & 21 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

FROM alpine:3
FROM alpine:3 as stage1

EXPOSE 8080 22222

Expand All @@ -11,25 +11,17 @@ ARG HAWTIO_VERSION

ENV \
TERM=xterm \
CATALINA_HOME=/opt/tomcat \
JAVA_HOME=/usr/lib/jvm/default-jvm \
PATH=${PATH}:/opt/jdk/bin:${CATALINA_HOME}/bin

# ---------------------------------------------------------------------------------------------------------------------
CATALINA_HOME=/opt/tomcat

# hadolint ignore=SC2035,DL3003,DL3017,DL3018,DL4006
RUN \
apk update --quiet --no-cache && \
apk upgrade --quiet --no-cache && \
apk add --quiet --no-cache \
curl \
nss \
openjdk11-jre-headless \
tomcat-native && \
echo "export LANG=C.UTF-8" > /etc/profile.d/locale.sh && \
echo 'hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4' >> /etc/nsswitch.conf && \
sed -i 's,#networkaddress.cache.ttl=-1,networkaddress.cache.ttl=30,' "${JAVA_HOME}/jre/conf/security/java.security" && \
[ -d /opt ] || mkdir /opt 2> /dev/null && \
curl && \
[ -d /opt ] || mkdir /opt 2> /dev/null

# hadolint ignore=DL4006
RUN \
echo "download tomcat version $TOMCAT_VERSION (https://archive.apache.org/dist/tomcat/tomcat-9/)" && \
curl \
--silent \
Expand All @@ -40,25 +32,33 @@ RUN \
| gunzip \
| tar x -C /opt/ && \
ln -s "/opt/apache-tomcat-$TOMCAT_VERSION" "${CATALINA_HOME}" && \
ln -s "${CATALINA_HOME}/logs" /var/log/jolokia && \
rm -rf "${CATALINA_HOME}/webapps/*" && \
rm -rf "${CATALINA_HOME}/webapps/*"

RUN \
ls -l "${CATALINA_HOME}" && \
echo "download jolokia version $JOLOKIA_VERSION (https://repo1.maven.org/maven2/org/jolokia/jolokia-war)" && \
curl \
--silent \
--location \
--retry 3 \
--cacert /etc/ssl/certs/ca-certificates.crt \
--output "${CATALINA_HOME}/webapps/jolokia.war" \
"https://repo1.maven.org/maven2/org/jolokia/jolokia-war/$JOLOKIA_VERSION/jolokia-war-$JOLOKIA_VERSION.war" && \
"https://repo1.maven.org/maven2/org/jolokia/jolokia-war/$JOLOKIA_VERSION/jolokia-war-$JOLOKIA_VERSION.war"

# hadolint ignore=DL3003
RUN \
echo "download hawtio version $HAWTIO_VERSION (https://github.com/hawtio/hawtio/tags)" && \
curl \
--silent \
--location \
--retry 3 \
--cacert /etc/ssl/certs/ca-certificates.crt \
--output "${CATALINA_HOME}/webapps/hawtio.war" \
"https://oss.sonatype.org/content/repositories/public/io/hawt/hawtio-default/$HAWTIO_VERSION/hawtio-default-$HAWTIO_VERSION.war" && \
cd "${CATALINA_HOME}/webapps/" && \
"https://oss.sonatype.org/content/repositories/public/io/hawt/hawtio-default/$HAWTIO_VERSION/hawtio-default-$HAWTIO_VERSION.war"

WORKDIR ${CATALINA_HOME}/webapps

RUN \
mkdir \
jolokia hawtio && \
unzip jolokia.war -d jolokia > /dev/null && \
Expand All @@ -68,14 +68,53 @@ RUN \
rm -f "${CATALINA_HOME}/NOTICE" && \
rm -f "${CATALINA_HOME}/RELEASE-NOTES" && \
rm -f "${CATALINA_HOME}/RUNNING.txt" && \
rm -f "${CATALINA_HOME}/bin/*.bat" && \
rm -f "${CATALINA_HOME}/bin/*.bat"

RUN \
ls -l /opt

# ---------------------------------------------------------------------------------------------------------------------

FROM alpine:3

EXPOSE 8080 22222

ARG BUILD_DATE
ARG BUILD_VERSION
ARG TOMCAT_VERSION
ARG JOLOKIA_VERSION
ARG HAWTIO_VERSION

ENV \
TERM=xterm \
CATALINA_HOME=/opt/tomcat \
JAVA_HOME=/usr/lib/jvm/default-jvm \
PATH=${PATH}:/opt/jdk/bin:${CATALINA_HOME}/bin

# ---------------------------------------------------------------------------------------------------------------------

# hadolint ignore=SC2035,DL3003,DL3017,DL3018,DL4006
RUN \
apk update --quiet --no-cache && \
apk upgrade --quiet --no-cache && \
apk add --quiet --no-cache \
curl \
nss \
openjdk11-jre-headless \
tomcat-native && \
echo "export LANG=C.UTF-8" > /etc/profile.d/locale.sh && \
echo 'hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4' >> /etc/nsswitch.conf && \
sed -i 's,#networkaddress.cache.ttl=-1,networkaddress.cache.ttl=30,' "${JAVA_HOME}/jre/conf/security/java.security" && \
ln -s "/opt/apache-tomcat-$TOMCAT_VERSION" "${CATALINA_HOME}" && \
ln -s "${CATALINA_HOME}/logs" /var/log/jolokia && \
rm -rf \
/tmp/* \
/var/cache/apk/*

WORKDIR ${CATALINA_HOME}/webapps/

COPY rootfs/ /
COPY --from=stage1 /opt /opt

CMD ["/init/run.sh"]

Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ export DOCKER_VERSION ?= latest
export BUILD_DATE := $(shell date +%Y-%m-%d)
export BUILD_VERSION := $(shell date +%y%m)
export BUILD_TYPE ?= stable
export TOMCAT_VERSION ?= 9.0.38
export JOLOKIA_VERSION ?= 1.6.2
export HAWTIO_VERSION ?= 2.10.2
export TOMCAT_VERSION ?= 9.0.56
export JOLOKIA_VERSION ?= 1.7.1
export HAWTIO_VERSION ?= 2.14.1


.PHONY: build shell run exec start stop clean compose-file
Expand Down
2 changes: 0 additions & 2 deletions hooks/stop
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/bin/bash

set -x

# Custom build for Docker Hub
# see: https://medium.com/microscaling-systems/labelling-automated-builds-on-docker-hub-f3d073fb8e1

Expand Down

0 comments on commit a1bb470

Please sign in to comment.