-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Dockerfiles to version 24.3.0
- Loading branch information
XebiaLabsCI
committed
Nov 7, 2024
1 parent
38e66be
commit 826d2a4
Showing
12 changed files
with
1,814 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,145 @@ | ||
FROM alpine:3.16 as installer | ||
|
||
# Install dependencies | ||
RUN apk update | ||
RUN apk add --no-cache gawk unzip curl busybox-extras | ||
|
||
|
||
|
||
|
||
# Set root folders | ||
ENV APP_ROOT=/opt/xebialabs \ | ||
APP_HOME=/opt/xebialabs/deploy-task-engine | ||
|
||
# Install deploy-task-engine from zip file | ||
COPY resources/deploy-task-engine-24.3.0.zip /tmp | ||
RUN mkdir -p ${APP_ROOT} && \ | ||
unzip /tmp/deploy-task-engine-24.3.0.zip -d ${APP_ROOT} && \ | ||
mv ${APP_ROOT}/deploy-task-engine-24.3.0 ${APP_HOME} && \ | ||
true | ||
|
||
# Create directories for external drivers | ||
RUN mkdir -p ${APP_HOME}/driver/jdbc && \ | ||
mkdir -p ${APP_HOME}/driver/mq | ||
|
||
# Add bin/run-in-container.sh | ||
COPY resources/bin/run-in-container.sh ${APP_HOME}/bin/run-in-container.sh | ||
|
||
# Add jmx-exporter for prometheus | ||
COPY resources/jmx-exporter/jmx_prometheus_javaagent.jar ${APP_HOME}/lib/ | ||
|
||
# Add (and run) Database driver download script | ||
COPY resources/bin/drivers.sh /tmp/drivers.sh | ||
RUN chmod ugo+x /tmp/drivers.sh && \ | ||
/bin/sh /tmp/drivers.sh | ||
|
||
# Modify bin/run.sh so that java becomes a child process of dumb-init | ||
RUN sed -i 's/^\($JAVACMD\)/exec \1/' ${APP_HOME}/bin/run.sh | ||
|
||
# Move and augment conf directory of regular install to default-conf so that when no external config is loaded we can use default | ||
RUN mv ${APP_HOME}/conf ${APP_HOME}/default-conf && \ | ||
mkdir ${APP_HOME}/conf | ||
COPY resources/default-conf ${APP_HOME}/default-conf | ||
COPY resources/jmx-exporter/jmx-exporter.yaml ${APP_HOME}/default-conf/ | ||
RUN mv ${APP_HOME}/default-conf/boot.conf.template ${APP_HOME}/default-conf/deployit.conf.template | ||
|
||
|
||
# Modify conf/xld-wrapper.conf.common to add node-conf to the classpath and to add container-specific VM options | ||
# ${APP_HOME}/node-conf will have first priority in classpath | ||
COPY resources/modify-wrapper-linux-conf.gawk /tmp | ||
RUN chmod +x /tmp/modify-wrapper-linux-conf.gawk && \ | ||
/tmp/modify-wrapper-linux-conf.gawk ${APP_HOME}/default-conf/xld-wrapper.conf.common > /tmp/xld-wrapper.conf.common && \ | ||
mv /tmp/xld-wrapper.conf.common ${APP_HOME}/default-conf/xld-wrapper.conf.common && \ | ||
rm /tmp/modify-wrapper-linux-conf.gawk | ||
|
||
# Move plugins directory to default-plugins, so that when no external plugins are loaded we can use the default | ||
RUN mv ${APP_HOME}/plugins ${APP_HOME}/default-plugins && \ | ||
mkdir ${APP_HOME}/plugins && \ | ||
# Create empty 'repository', 'work', 'export', 'archive' and 'reports' directory | ||
mkdir ${APP_HOME}/repository ${APP_HOME}/export ${APP_HOME}/archive ${APP_HOME}/work ${APP_HOME}/reports | ||
|
||
# Set permissions | ||
RUN chgrp -R 0 ${APP_ROOT} && \ | ||
chmod -R g=u ${APP_ROOT} && \ | ||
chmod ugo+x ${APP_HOME}/bin/*.sh | ||
|
||
|
||
FROM amazonlinux:2 | ||
|
||
|
||
LABEL name="xebialabs/deploy-task-engine" \ | ||
vendor="Digital.ai" \ | ||
version="24.3.0" \ | ||
release="1" \ | ||
summary="Deploy Worker" \ | ||
description="Enterprise-scale Application Release Automation for any environment" \ | ||
url="https://digital.ai/products/deploy/" | ||
|
||
|
||
# Set root folders | ||
ENV APP_ROOT=/opt/xebialabs \ | ||
APP_HOME=/opt/xebialabs/deploy-task-engine | ||
|
||
|
||
# Install dependencies | ||
RUN yum update -y && \ | ||
yum install -y java-17-amazon-corretto curl jq shadow-utils.x86_64 hostname unzip which telnet && \ | ||
yum clean all -q | ||
|
||
# Copy installed Deploy Worker | ||
COPY --from=installer ${APP_ROOT} ${APP_ROOT} | ||
|
||
ENV OS=amazonlinux | ||
|
||
|
||
# install Terraform | ||
ENV TERRAFORM_VERSION=0.11.13 | ||
|
||
RUN curl -o /tmp/terraform.zip https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip && \ | ||
unzip /tmp/terraform.zip -d /usr/local/bin && \ | ||
rm -f /tmp/terraform.zip | ||
|
||
|
||
|
||
# Set ttl for DNS cache | ||
RUN echo $'\n#\n# Set TTL for DNS cache.\nnetworkaddress.cache.ttl=30' >> $(readlink -f `which java` | sed -e 's:/jre/bin/java::' -e 's:/bin/java::')/conf/security/java.security | ||
|
||
COPY resources/amd64/tini ${APP_ROOT} | ||
RUN chmod ugo+x ${APP_ROOT}/tini | ||
|
||
# Add xebialabs user but do not switch to it | ||
RUN groupadd -r -g 10001 xebialabs && \ | ||
useradd -r -u 10001 -g 0 -G xebialabs xebialabs | ||
|
||
WORKDIR ${APP_HOME} | ||
|
||
ENV APP_PORT=4516 \ | ||
XL_DB_URL=jdbc:derby:repository/db;create=true \ | ||
XLD_TASK_QUEUE_NAME=xld-tasks-queue \ | ||
XLD_TASK_QUEUE_IN_PROCESS_MAX_DISK_USAGE=100 \ | ||
XLD_TASK_QUEUE_IN_PROCESS_SHUTDOWN_TIMEOUT=60000 \ | ||
XLD_TASK_QUEUE_DRIVER_CLASS_NAME= \ | ||
XLD_TASK_QUEUE_URL= \ | ||
XLD_TASK_QUEUE_USERNAME= \ | ||
XLD_TASK_QUEUE_PASSWORD= \ | ||
XLD_TASK_QUEUE_IS_QUORUM=false \ | ||
PLUGIN_SOURCE=database \ | ||
USE_EXTERNAL_CENTRAL_CONFIG=false \ | ||
CENTRAL_CONFIG_URL= \ | ||
CENTRAL_CONFIG_ENCRYPT_KEY= \ | ||
LOGBACK_GLOBAL_LOGGING_LEVEL=info \ | ||
LOGBACK_SCAN_ENABLED=true \ | ||
LOGBACK_SCAN_PERIOD=30seconds | ||
|
||
|
||
USER 10001 | ||
|
||
VOLUME ["${APP_HOME}/conf", "${APP_HOME}/driver/jdbc", "${APP_HOME}/driver/mq", "${APP_HOME}/ext", "${APP_HOME}/hotfix/lib", "${APP_HOME}/hotfix/plugins", "${APP_HOME}/plugins", "${APP_HOME}/work"] | ||
|
||
EXPOSE ${APP_PORT} | ||
|
||
# Environment variables are not expanded when using the exec form of the ENTRYPOINT command. They are | ||
# expanded when using the shell form, but that results in tini running with a PID higher than 1. | ||
|
||
|
||
ENTRYPOINT ["/opt/xebialabs/tini", "--", "/opt/xebialabs/deploy-task-engine/bin/run-in-container.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,147 @@ | ||
FROM alpine:3.16 as installer | ||
|
||
# Install dependencies | ||
RUN apk update | ||
RUN apk add --no-cache gawk unzip curl busybox-extras | ||
|
||
|
||
|
||
|
||
# Set root folders | ||
ENV APP_ROOT=/opt/xebialabs \ | ||
APP_HOME=/opt/xebialabs/deploy-task-engine | ||
|
||
# Install deploy-task-engine from zip file | ||
COPY resources/deploy-task-engine-24.3.0.zip /tmp | ||
RUN mkdir -p ${APP_ROOT} && \ | ||
unzip /tmp/deploy-task-engine-24.3.0.zip -d ${APP_ROOT} && \ | ||
mv ${APP_ROOT}/deploy-task-engine-24.3.0 ${APP_HOME} && \ | ||
true | ||
|
||
# Create directories for external drivers | ||
RUN mkdir -p ${APP_HOME}/driver/jdbc && \ | ||
mkdir -p ${APP_HOME}/driver/mq | ||
# Remove bundled drivers if slim | ||
RUN rm ${APP_HOME}/lib/derby*.jar | ||
|
||
# Add bin/run-in-container.sh | ||
COPY resources/bin/run-in-container.sh.slim ${APP_HOME}/bin/run-in-container.sh | ||
|
||
# Add jmx-exporter for prometheus | ||
COPY resources/jmx-exporter/jmx_prometheus_javaagent.jar ${APP_HOME}/lib/ | ||
|
||
# Add (and run) Database driver download script | ||
COPY resources/bin/drivers.sh.slim /tmp/drivers.sh | ||
RUN chmod ugo+x /tmp/drivers.sh && \ | ||
/bin/sh /tmp/drivers.sh | ||
# Modify bin/run.sh so that java becomes a child process of dumb-init | ||
RUN sed -i 's/^\($JAVACMD\)/exec \1/' ${APP_HOME}/bin/run.sh | ||
|
||
# Move and augment conf directory of regular install to default-conf so that when no external config is loaded we can use default | ||
RUN mv ${APP_HOME}/conf ${APP_HOME}/default-conf && \ | ||
mkdir ${APP_HOME}/conf | ||
COPY resources/default-conf ${APP_HOME}/default-conf | ||
COPY resources/jmx-exporter/jmx-exporter.yaml ${APP_HOME}/default-conf/ | ||
RUN mv ${APP_HOME}/default-conf/boot.conf.template ${APP_HOME}/default-conf/deployit.conf.template | ||
|
||
|
||
# Modify conf/xld-wrapper.conf.common to add node-conf to the classpath and to add container-specific VM options | ||
# ${APP_HOME}/node-conf will have first priority in classpath | ||
COPY resources/modify-wrapper-linux-conf.gawk /tmp | ||
RUN chmod +x /tmp/modify-wrapper-linux-conf.gawk && \ | ||
/tmp/modify-wrapper-linux-conf.gawk ${APP_HOME}/default-conf/xld-wrapper.conf.common > /tmp/xld-wrapper.conf.common && \ | ||
mv /tmp/xld-wrapper.conf.common ${APP_HOME}/default-conf/xld-wrapper.conf.common && \ | ||
rm /tmp/modify-wrapper-linux-conf.gawk | ||
|
||
# Move plugins directory to default-plugins, so that when no external plugins are loaded we can use the default | ||
RUN mv ${APP_HOME}/plugins ${APP_HOME}/default-plugins && \ | ||
mkdir ${APP_HOME}/plugins && \ | ||
# Create empty 'repository', 'work', 'export', 'archive' and 'reports' directory | ||
mkdir ${APP_HOME}/repository ${APP_HOME}/export ${APP_HOME}/archive ${APP_HOME}/work ${APP_HOME}/reports | ||
|
||
# Set permissions | ||
RUN chgrp -R 0 ${APP_ROOT} && \ | ||
chmod -R g=u ${APP_ROOT} && \ | ||
chmod ugo+x ${APP_HOME}/bin/*.sh | ||
|
||
|
||
FROM amazonlinux:2 | ||
|
||
|
||
LABEL name="xebialabs/deploy-task-engine" \ | ||
vendor="Digital.ai" \ | ||
version="24.3.0" \ | ||
release="1" \ | ||
summary="Deploy Worker" \ | ||
description="Enterprise-scale Application Release Automation for any environment" \ | ||
url="https://digital.ai/products/deploy/" | ||
|
||
|
||
# Set root folders | ||
ENV APP_ROOT=/opt/xebialabs \ | ||
APP_HOME=/opt/xebialabs/deploy-task-engine | ||
|
||
|
||
# Install dependencies | ||
RUN yum update -y && \ | ||
yum install -y java-17-amazon-corretto curl jq shadow-utils.x86_64 hostname unzip which telnet && \ | ||
yum clean all -q | ||
|
||
# Copy installed Deploy Worker | ||
COPY --from=installer ${APP_ROOT} ${APP_ROOT} | ||
|
||
ENV OS=amazonlinux | ||
|
||
|
||
# install Terraform | ||
ENV TERRAFORM_VERSION=0.11.13 | ||
|
||
RUN curl -o /tmp/terraform.zip https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip && \ | ||
unzip /tmp/terraform.zip -d /usr/local/bin && \ | ||
rm -f /tmp/terraform.zip | ||
|
||
|
||
|
||
# Set ttl for DNS cache | ||
RUN echo $'\n#\n# Set TTL for DNS cache.\nnetworkaddress.cache.ttl=30' >> $(readlink -f `which java` | sed -e 's:/jre/bin/java::' -e 's:/bin/java::')/conf/security/java.security | ||
|
||
COPY resources/amd64/tini ${APP_ROOT} | ||
RUN chmod ugo+x ${APP_ROOT}/tini | ||
|
||
# Add xebialabs user but do not switch to it | ||
RUN groupadd -r -g 10001 xebialabs && \ | ||
useradd -r -u 10001 -g 0 -G xebialabs xebialabs | ||
|
||
WORKDIR ${APP_HOME} | ||
|
||
ENV APP_PORT=4516 \ | ||
XL_DB_URL=jdbc:derby:repository/db;create=true \ | ||
XLD_TASK_QUEUE_NAME=xld-tasks-queue \ | ||
XLD_TASK_QUEUE_IN_PROCESS_MAX_DISK_USAGE=100 \ | ||
XLD_TASK_QUEUE_IN_PROCESS_SHUTDOWN_TIMEOUT=60000 \ | ||
XLD_TASK_QUEUE_DRIVER_CLASS_NAME= \ | ||
XLD_TASK_QUEUE_URL= \ | ||
XLD_TASK_QUEUE_USERNAME= \ | ||
XLD_TASK_QUEUE_PASSWORD= \ | ||
XLD_TASK_QUEUE_IS_QUORUM=false \ | ||
PLUGIN_SOURCE=database \ | ||
USE_EXTERNAL_CENTRAL_CONFIG=false \ | ||
CENTRAL_CONFIG_URL= \ | ||
CENTRAL_CONFIG_ENCRYPT_KEY= \ | ||
LOGBACK_GLOBAL_LOGGING_LEVEL=info \ | ||
LOGBACK_SCAN_ENABLED=true \ | ||
LOGBACK_SCAN_PERIOD=30seconds | ||
|
||
|
||
USER 10001 | ||
|
||
VOLUME ["${APP_HOME}/conf", "${APP_HOME}/driver/jdbc", "${APP_HOME}/driver/mq", "${APP_HOME}/ext", "${APP_HOME}/hotfix/lib", "${APP_HOME}/hotfix/plugins", "${APP_HOME}/plugins", "${APP_HOME}/work"] | ||
|
||
EXPOSE ${APP_PORT} | ||
|
||
# Environment variables are not expanded when using the exec form of the ENTRYPOINT command. They are | ||
# expanded when using the shell form, but that results in tini running with a PID higher than 1. | ||
|
||
|
||
ENTRYPOINT ["/opt/xebialabs/tini", "--", "/opt/xebialabs/deploy-task-engine/bin/run-in-container.sh"] |
Oops, something went wrong.