Skip to content

Commit

Permalink
Merge pull request #38 from klaros-testmanagement/development/image-b…
Browse files Browse the repository at this point in the history
…uilder

Development/image builder
  • Loading branch information
klaros-testmanagement authored Oct 19, 2020
2 parents 5283897 + d027911 commit a635586
Show file tree
Hide file tree
Showing 28 changed files with 1,500 additions and 99 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*.jar
.test/
/.project
/.settings/
/.project
2 changes: 1 addition & 1 deletion .html/Documentation-German.html
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ <h1>Klaros-Testmanagement Docker-Integration</h1>
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p><span class="image"><a class="image" href="https://github.com/klaros-testmanagement/klaros-docker/releases"><img src="https://img.shields.io/badge/Version-4.12.7-green.svg" alt="Version 4.12.7 green"></a></span>
<p><span class="image"><a class="image" href="https://github.com/klaros-testmanagement/klaros-docker/releases"><img src="https://img.shields.io/badge/Version-5.0.3-green.svg" alt="Version 5.0.3 green"></a></span>
<span class="image"><a class="image" href="https://github.com/klaros-testmanagement/klaros-docker/blob/master/LICENSE"><img src="https://img.shields.io/badge/License-MIT-green" alt="License MIT green"></a></span>
<span class="image"><a class="image" href="https://www.klaros-testmanagement.com/en_US/download"><img src="https://img.shields.io/badge/Community%20Edition-FREE-green" alt="Community%20Edition FREE green"></a></span>
<span class="image right"><a class="image" href="https://twitter.com/intent/follow?screen_name=Klaros_TM"><img src="https://img.shields.io/twitter/follow/Klaros_TM?style=social" alt="Klaros TM?style=social"></a></span></p>
Expand Down
2 changes: 1 addition & 1 deletion .html/Documentation.html
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ <h1>Klaros Test Management Docker-Integration</h1>
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p><span class="image"><a class="image" href="https://github.com/klaros-testmanagement/klaros-docker/releases"><img src="https://img.shields.io/badge/Version-4.12.7-green.svg" alt="Version 4.12.7 green"></a></span>
<p><span class="image"><a class="image" href="https://github.com/klaros-testmanagement/klaros-docker/releases"><img src="https://img.shields.io/badge/Version-5.0.3-green.svg" alt="Version 5.0.3 green"></a></span>
<span class="image"><a class="image" href="https://github.com/klaros-testmanagement/klaros-docker/blob/master/LICENSE"><img src="https://img.shields.io/badge/License-MIT-green" alt="License MIT green"></a></span>
<span class="image"><a class="image" href="https://www.klaros-testmanagement.com/en_US/download"><img src="https://img.shields.io/badge/Community%20Edition-FREE-green" alt="Community%20Edition FREE green"></a></span>
<span class="image right"><a class="image" href="https://twitter.com/intent/follow?screen_name=Klaros_TM"><img src="https://img.shields.io/twitter/follow/Klaros_TM?style=social" alt="Klaros TM?style=social"></a></span></p>
Expand Down
2 changes: 1 addition & 1 deletion .html/README-German.html
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ <h1>Klaros-Testmanagement Docker-Integration</h1>
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p><span class="image"><a class="image" href="https://github.com/klaros-testmanagement/klaros-docker/releases"><img src="https://img.shields.io/badge/Version-4.12.7-green.svg" alt="Version 4.12.7 green"></a></span>
<p><span class="image"><a class="image" href="https://github.com/klaros-testmanagement/klaros-docker/releases"><img src="https://img.shields.io/badge/Version-5.0.3-green.svg" alt="Version 5.0.3 green"></a></span>
<span class="image"><a class="image" href="https://github.com/klaros-testmanagement/klaros-docker/blob/master/LICENSE"><img src="https://img.shields.io/badge/License-MIT-green" alt="License MIT green"></a></span>
<span class="image"><a class="image" href="https://www.klaros-testmanagement.com/en_US/download"><img src="https://img.shields.io/badge/Community%20Edition-FREE-green" alt="Community%20Edition FREE green"></a></span>
<span class="image right"><a class="image" href="https://twitter.com/intent/follow?screen_name=Klaros_TM"><img src="https://img.shields.io/twitter/follow/Klaros_TM?style=social" alt="Klaros TM?style=social"></a></span></p>
Expand Down
2 changes: 1 addition & 1 deletion .html/README.html
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ <h1>Klaros Test Management Docker-Integration</h1>
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p><span class="image"><a class="image" href="https://github.com/klaros-testmanagement/klaros-docker/releases"><img src="https://img.shields.io/badge/Version-4.12.7-green.svg" alt="Version 4.12.7 green"></a></span>
<p><span class="image"><a class="image" href="https://github.com/klaros-testmanagement/klaros-docker/releases"><img src="https://img.shields.io/badge/Version-5.0.3-green.svg" alt="Version 5.0.3 green"></a></span>
<span class="image"><a class="image" href="https://github.com/klaros-testmanagement/klaros-docker/blob/master/LICENSE"><img src="https://img.shields.io/badge/License-MIT-green" alt="License MIT green"></a></span>
<span class="image"><a class="image" href="https://www.klaros-testmanagement.com/en_US/download"><img src="https://img.shields.io/badge/Community%20Edition-FREE-green" alt="Community%20Edition FREE green"></a></span>
<span class="image right"><a class="image" href="https://twitter.com/intent/follow?screen_name=Klaros_TM"><img src="https://img.shields.io/twitter/follow/Klaros_TM?style=social" alt="Klaros TM?style=social"></a></span></p>
Expand Down
4 changes: 2 additions & 2 deletions ApacheDerby/.start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ KT_DIR_WEB=/root/klaros-testmanagement/webapps
KT_DIR_CONF=/root/klaros-testmanagement/conf
counter=0

function ctrl_c() {
ctrl_c() {
echo ""
counter=$((counter + 1))
if [ "$counter" = 1 ]; then
Expand Down Expand Up @@ -66,7 +66,7 @@ else
ln -s $KT_DIR_WEB $CA_DIR_WEB
fi

trap "ctrl_c" SIGTERM 2
trap "ctrl_c" TERM 2

./root/klaros-testmanagement/bin/catalina.sh run &

Expand Down
16 changes: 7 additions & 9 deletions ApacheDerby/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# Do not use it for production systems. Please take a look at the documentation.
#

FROM openjdk:8u212-alpine
FROM adoptopenjdk:11-jre-hotspot
LABEL maintainer "BreadSpoon <[email protected]>"

# Set Klaros language. Use 'deu' for german and 'eng' for english.
Expand All @@ -27,18 +27,18 @@ ENV TOMCAT_ADMIN_PASSWORD P@ssw0rd
ENV TOMCAT_SESSION_TIMEOUT 60

# Minimum available RAM in MB
ENV TOMCAT_MEMORY_MIN 128
ENV TOMCAT_MEMORY_MIN 256

# Maximum available RAM in MB
ENV TOMCAT_MEMORY_MAX 768
ENV TOMCAT_MEMORY_MAX 1024

# You can set the port by creating a container: docker create --name Klaros -p 18080:18080 klaros
ENV TOMCAT_HTTP_PORT ${TOMCAT_HTTP_PORT:-18080}
ENV TOMCAT_SERVER_PORT ${TOMCAT_SERVER_PORT:-18005}
ENV TOMCAT_AJP_PORT ${TOMCAT_AJP_PORT:-18009}

# Klaros release version, which is used during installation. A list of available releases can be found on the official Klaros Test Management website or on GitHub.
ENV KLAROS_VERSION ${KLAROS_VERSION:-4.12.7}
ENV KLAROS_VERSION ${KLAROS_VERSION:-5.0.3}

ENV KLAROS_HOME /data/klaros-home
ENV CATALINA_BASE /data/catalina-base
Expand All @@ -50,10 +50,8 @@ ADD https://www.klaros-testmanagement.com/files/${KLAROS_VERSION}/Klaros-${KLARO
ADD .start.sh /

RUN set -xe \
&& apk update \
&& apk add --no-cache \
fontconfig \
ghostscript-fonts \
&& apt-get -y update \
&& apt-get install -y fontconfig gsfonts \
&& sed -i "s/@@TOMCAT_ADMIN_PASSWORD@@/${TOMCAT_ADMIN_PASSWORD}/g;s/@@TOMCAT_HTTP_PORT@@/${TOMCAT_HTTP_PORT}/g;s/@@TOMCAT_SERVER_PORT@@/${TOMCAT_SERVER_PORT}/g;s/@@TOMCAT_AJP_PORT@@/${TOMCAT_AJP_PORT}/g;s/@@TOMCAT_SESSION_TIMEOUT@@/${TOMCAT_SESSION_TIMEOUT}/g;s/@@TOMCAT_MEMORY_MAX@@/${TOMCAT_MEMORY_MAX}/g;s/@@TOMCAT_MEMORY_MIN@@/${TOMCAT_MEMORY_MIN}/g;s/@@KLAROS_LANG@@/${KLAROS_LANG}/g" /tmp/auto-install.xml \
&& echo "~~~~~" && cat /tmp/auto-install.xml && echo "~~~~~"

Expand All @@ -68,4 +66,4 @@ RUN chmod +x /.start.sh

VOLUME /data

CMD [ "/.start.sh", "run" ]
CMD [ "/.start.sh", "run" ]
4 changes: 2 additions & 2 deletions MariaDB/.env
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ KLAROS_CONTAINER_NAME=klaros_mariadb
TIMEZONE=

# Minimum available RAM in MB
MEMORY_MIN=128
MEMORY_MIN=256

# Maximum available RAM in MB
MEMORY_MAX=786
MEMORY_MAX=1024

# Name of the volume. It contains all your stored data.
VOLUME_NAME=klaros-data
136 changes: 134 additions & 2 deletions MariaDB/db/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,137 @@
FROM verit/klaros-mariadb_db:4.12.7
# vim:set ft=dockerfile:
FROM ubuntu:bionic
LABEL maintainer "BreadSpoon <[email protected]>"

# add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added
RUN groupadd -r mysql && useradd -r -g mysql mysql

# https://bugs.debian.org/830696 (apt uses gpgv by default in newer releases, rather than gpg)
RUN set -ex; \
apt-get update; \
if ! which gpg; then \
apt-get install -y --no-install-recommends gnupg; \
fi; \
if ! gpg --version | grep -q '^gpg (GnuPG) 1\.'; then \
# Ubuntu includes "gnupg" (not "gnupg2", but still 2.x), but not dirmngr, and gnupg 2.x requires dirmngr
# so, if we're not running gnupg 1.x, explicitly install dirmngr too
apt-get install -y --no-install-recommends dirmngr; \
fi; \
rm -rf /var/lib/apt/lists/*

# add gosu for easy step-down from root
ENV GOSU_VERSION 1.10
RUN set -ex; \
\
fetchDeps=' \
ca-certificates \
wget \
'; \
apt-get update; \
apt-get install -y --no-install-recommends $fetchDeps; \
rm -rf /var/lib/apt/lists/*; \
\
dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')"; \
wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch"; \
wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch.asc"; \
\
# verify the signature
export GNUPGHOME="$(mktemp -d)"; \
gpg --batch --keyserver hkp://keyserver.ubuntu.com --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4; \
gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu; \
command -v gpgconf > /dev/null && gpgconf --kill all || :; \
rm -r "$GNUPGHOME" /usr/local/bin/gosu.asc; \
\
chmod +x /usr/local/bin/gosu; \
# verify that the binary works
gosu nobody true; \
\
apt-get purge -y --auto-remove $fetchDeps

RUN mkdir /docker-entrypoint-initdb.d

# install "pwgen" for randomizing passwords
# install "tzdata" for /usr/share/zoneinfo/
# install "xz-utils" for .sql.xz docker-entrypoint-initdb.d files
RUN set -ex; \
apt-get update; \
apt-get install -y --no-install-recommends \
pwgen \
tzdata \
xz-utils \
; \
rm -rf /var/lib/apt/lists/*

ENV GPG_KEYS \
# pub rsa4096 2016-03-30 [SC]
# 177F 4010 FE56 CA33 3630 0305 F165 6F24 C74C D1D8
# uid [ unknown] MariaDB Signing Key <[email protected]>
# sub rsa4096 2016-03-30 [E]
177F4010FE56CA3336300305F1656F24C74CD1D8
RUN set -ex; \
export GNUPGHOME="$(mktemp -d)"; \
for key in $GPG_KEYS; do \
gpg --batch --keyserver hkp://keyserver.ubuntu.com --recv-keys "$key"; \
done; \
gpg --batch --export $GPG_KEYS > /etc/apt/trusted.gpg.d/mariadb.gpg; \
command -v gpgconf > /dev/null && gpgconf --kill all || :; \
rm -r "$GNUPGHOME"; \
apt-key list

# bashbrew-architectures: amd64 arm64v8 ppc64le
ENV MARIADB_MAJOR 10.4
ENV MARIADB_VERSION 1:10.4.15+maria~bionic
# release-status:Stable
# (https://downloads.mariadb.org/mariadb/+releases/)

RUN set -e;\
echo "deb http://ftp.osuosl.org/pub/mariadb/repo/$MARIADB_MAJOR/ubuntu bionic main" > /etc/apt/sources.list.d/mariadb.list; \
{ \
echo 'Package: *'; \
echo 'Pin: release o=MariaDB'; \
echo 'Pin-Priority: 999'; \
} > /etc/apt/preferences.d/mariadb
# add repository pinning to make sure dependencies from this MariaDB repo are preferred over Debian dependencies
# libmariadbclient18 : Depends: libmysqlclient18 (= 5.5.42+maria-1~wheezy) but 5.5.43-0+deb7u1 is to be installed

# the "/var/lib/mysql" stuff here is because the mysql-server postinst doesn't have an explicit way to disable the mysql_install_db codepath besides having a database already "configured" (ie, stuff in /var/lib/mysql/mysql)
# also, we set debconf keys to make APT a little quieter
RUN set -ex; \
{ \
echo "mariadb-server-$MARIADB_MAJOR" mysql-server/root_password password 'unused'; \
echo "mariadb-server-$MARIADB_MAJOR" mysql-server/root_password_again password 'unused'; \
} | debconf-set-selections; \
apt-get update; \
apt-get install -y \
"mariadb-server=$MARIADB_VERSION" \
# mariadb-backup is installed at the same time so that `mysql-common` is only installed once from just mariadb repos
mariadb-backup \
socat \
; \
rm -rf /var/lib/apt/lists/*; \
# comment out any "user" entires in the MySQL config ("docker-entrypoint.sh" or "--user" will handle user switching)
sed -ri 's/^user\s/#&/' /etc/mysql/my.cnf /etc/mysql/conf.d/*; \
# purge and re-create /var/lib/mysql with appropriate ownership
rm -rf /var/lib/mysql; \
mkdir -p /var/lib/mysql /var/run/mysqld; \
chown -R mysql:mysql /var/lib/mysql /var/run/mysqld; \
# ensure that /var/run/mysqld (used for socket and lock files) is writable regardless of the UID our mysqld instance ends up having at runtime
chmod 777 /var/run/mysqld; \
# comment out a few problematic configuration values
find /etc/mysql/ -name '*.cnf' -print0 \
| xargs -0 grep -lZE '^(bind-address|log)' \
| xargs -rt -0 sed -Ei 's/^(bind-address|log)/#&/'; \
# don't reverse lookup hostnames, they are usually another container
echo '[mysqld]\nskip-host-cache\nskip-name-resolve' > /etc/mysql/conf.d/docker.cnf


COPY docker-entrypoint.sh /usr/local/bin/

COPY *.cnf /etc/mysql/mariadb.conf.d
RUN chmod 444 /etc/mysql/mariadb.conf.d/mysqld.cnf
RUN chmod 444 /etc/mysql/mariadb.conf.d/mysqld.cnf
RUN chmod 777 /usr/local/bin/docker-entrypoint.sh

RUN ln -s usr/local/bin/docker-entrypoint.sh / # backwards compat
ENTRYPOINT ["docker-entrypoint.sh"]

EXPOSE 3306
CMD ["mysqld"]
Loading

0 comments on commit a635586

Please sign in to comment.