Definitive Media Library (DML)

In our previous steps, we setup Nexus3 for Artifact storage and pre-populated build assets and artifacts for our initial installation procedures. So far this included the following:

  • Ubuntu Docker Image artifacts (Focal 20.04)
  • OpenJDK8
  • Nexus3
  • Wait-for Script

To continue with our Infrastructure setup we will need additional public artifacts including:

  • OpenJDK11
  • OpenJDK12
  • Jenkins and Jenkins Plugin Manager
  • Apache Maven
  • Tini Script
  • Docker and Docker Compose
  • Bitbucket
  • Sonarqube
  • gosu Script
labimagesnexus-dml
SERIAL=20220801
40795f39d0f4d3187c0132c5c1d0cb73195caaa8097e0486d75f8edc8cd109b0  ubuntu-focal-oci-amd64-root.manifest
908896fee17c7c3c7b35981d3e5030afa066f2a757a00df9521390308e15275c  ubuntu-focal-oci-amd64-root.tar.gz
afde2e714e09e78ca4bbeb2700ac706cd7b174fab0b5525edc5fec0458c0bfab  ubuntu-focal-oci-arm64-root.manifest
2099d1899e7e6b110a2bb269edb7e2322e4f75a266f6e562ae3c1c189e06394d  ubuntu-focal-oci-arm64-root.tar.gz
45bfb3d20ad9797fd3442e4179ef4bc28a7681c77bd3c74b8e2484a8afd67e3b  ubuntu-focal-oci-armhf-root.manifest
1cdd75754be4bbb65155133d91d0521cf206839ce5ad41fa0cef1b0df74ad9ac  ubuntu-focal-oci-armhf-root.tar.gz
979c58ab736eaf720ae1244e396590a271ddac602208b28223de53c06efeca81  ubuntu-focal-oci-ppc64el-root.manifest
d3f7688ce2d1bb682783f6b10d37ca0d77e1115384932f29d9bf8b98b973c4ef  ubuntu-focal-oci-ppc64el-root.tar.gz
e5b5dfc3ffe3168e28b965a64f5c8643d619f612268dabd9cd17029f1feeab2d  ubuntu-focal-oci-riscv64-root.manifest
126291630fbacebacfec221e0d3f12653f4857ad989257dc17fe78300dd5d7b0  ubuntu-focal-oci-riscv64-root.tar.gz
d9a475e2eddc1bec1fc75a257095aeced3156f17c0d0a1c0a72309bfe70575ae  ubuntu-focal-oci-s390x-root.manifest
c834e3f65025b7cb79e0f5749ba496fda8e5233ce5a37641ddc0ff7a832a62a9  ubuntu-focal-oci-s390x-root.tar.gz
n/a
adduser	3.118ubuntu2
apt	2.0.9
base-files	11ubuntu5.5
base-passwd	3.5.47
bash	5.0-6ubuntu1.2
bsdutils	1:2.34-0.1ubuntu9.3
bzip2	1.0.8-2
coreutils	8.30-3ubuntu2
dash	0.5.10.2-6
debconf	1.5.73
debianutils	4.9.1
diffutils	1:3.7-3
dpkg	1.19.7ubuntu3.2
e2fsprogs	1.45.5-2ubuntu1.1
fdisk	2.34-0.1ubuntu9.3
findutils	4.7.0-1ubuntu1
gcc-10-base:amd64	10.3.0-1ubuntu1~20.04
gpgv	2.2.19-3ubuntu2.2
grep	3.4-1
gzip	1.10-0ubuntu4.1
hostname	3.23
init-system-helpers	1.57
libacl1:amd64	2.2.53-6
libapt-pkg6.0:amd64	2.0.9
libattr1:amd64	1:2.4.48-5
libaudit-common	1:2.8.5-2ubuntu6
libaudit1:amd64	1:2.8.5-2ubuntu6
libblkid1:amd64	2.34-0.1ubuntu9.3
libbz2-1.0:amd64	1.0.8-2
libc-bin	2.31-0ubuntu9.9
libc6:amd64	2.31-0ubuntu9.9
libcap-ng0:amd64	0.7.9-2.1build1
libcom-err2:amd64	1.45.5-2ubuntu1.1
libcrypt1:amd64	1:4.4.10-10ubuntu4
libdb5.3:amd64	5.3.28+dfsg1-0.6ubuntu2
libdebconfclient0:amd64	0.251ubuntu1
libext2fs2:amd64	1.45.5-2ubuntu1.1
libfdisk1:amd64	2.34-0.1ubuntu9.3
libffi7:amd64	3.3-4
libgcc-s1:amd64	10.3.0-1ubuntu1~20.04
libgcrypt20:amd64	1.8.5-5ubuntu1.1
libgmp10:amd64	2:6.2.0+dfsg-4
libgnutls30:amd64	3.6.13-2ubuntu1.6
libgpg-error0:amd64	1.37-1
libhogweed5:amd64	3.5.1+really3.5.1-2ubuntu0.2
libidn2-0:amd64	2.2.0-2
liblz4-1:amd64	1.9.2-2ubuntu0.20.04.1
liblzma5:amd64	5.2.4-1ubuntu1.1
libmount1:amd64	2.34-0.1ubuntu9.3
libncurses6:amd64	6.2-0ubuntu2
libncursesw6:amd64	6.2-0ubuntu2
libnettle7:amd64	3.5.1+really3.5.1-2ubuntu0.2
libp11-kit0:amd64	0.23.20-1ubuntu0.1
libpam-modules:amd64	1.3.1-5ubuntu4.3
libpam-modules-bin	1.3.1-5ubuntu4.3
libpam-runtime	1.3.1-5ubuntu4.3
libpam0g:amd64	1.3.1-5ubuntu4.3
libpcre2-8-0:amd64	10.34-7
libpcre3:amd64	2:8.39-12ubuntu0.1
libprocps8:amd64	2:3.3.16-1ubuntu2.3
libseccomp2:amd64	2.5.1-1ubuntu1~20.04.2
libselinux1:amd64	3.0-1build2
libsemanage-common	3.0-1build2
libsemanage1:amd64	3.0-1build2
libsepol1:amd64	3.0-1ubuntu0.1
libsmartcols1:amd64	2.34-0.1ubuntu9.3
libss2:amd64	1.45.5-2ubuntu1.1
libstdc++6:amd64	10.3.0-1ubuntu1~20.04
libsystemd0:amd64	245.4-4ubuntu3.17
libtasn1-6:amd64	4.16.0-2
libtinfo6:amd64	6.2-0ubuntu2
libudev1:amd64	245.4-4ubuntu3.17
libunistring2:amd64	0.9.10-2
libuuid1:amd64	2.34-0.1ubuntu9.3
libzstd1:amd64	1.4.4+dfsg-3ubuntu0.1
login	1:4.8.1-1ubuntu5.20.04.2
logsave	1.45.5-2ubuntu1.1
lsb-base	11.1.0ubuntu2
mawk	1.3.4.20200120-2
mount	2.34-0.1ubuntu9.3
ncurses-base	6.2-0ubuntu2
ncurses-bin	6.2-0ubuntu2
passwd	1:4.8.1-1ubuntu5.20.04.2
perl-base	5.30.0-9ubuntu0.2
procps	2:3.3.16-1ubuntu2.3
sed	4.7-1
sensible-utils	0.0.12+nmu1
sysvinit-utils	2.96-2.1ubuntu1
tar	1.30+dfsg-7ubuntu0.20.04.2
ubuntu-keyring	2020.02.11.4
util-linux	2.34-0.1ubuntu9.3
zlib1g:amd64	1:1.2.11.dfsg-2ubuntu1.3
version: '3.3'

services:
  nexus-dml:
    image: infra/dml:1.0.0
    build:
      context: .
      network: host
      args:
        ARG_ART_URL: http://d1i-doc-ngbuild:3001
      extra_hosts:
        - "d1i-doc-ngbuild:172.22.90.2"
FROM infra/ubuntu/focal:1.0.0

ARG ARG_ART_URL

RUN sed -e "s|APT_URL|${ARG_ART_URL}|" /etc/apt/sources.list.base > /etc/apt/sources.list \
    && apt-get update \
    && apt-get install -y curl netcat dos2unix \
    && apt-get clean \
    && rm /etc/apt/sources.list

#####################################
## REPEATED FROM SEED FOR UPDATES
#####################################

#####################################
## UBUNTU FOCAL 20.04
## https://github.com/tianon/docker-brew-ubuntu-core/tree/dist-amd64/focal
#####################################

COPY ubuntu-focal/build-info.txt /tmp/ubuntu-focal/build-info.txt
COPY ubuntu-focal/SHA256SUMS /tmp/ubuntu-focal/SHA256SUMS
COPY ubuntu-focal/ubuntu-focal-oci-amd64-root.tar.gz /tmp/ubuntu-focal/ubuntu-focal-oci-amd64-root.tar.gz
COPY ubuntu-focal/ubuntu-focal-oci-amd64.manifest /tmp/ubuntu-focal/ubuntu-focal-oci-amd64.manifest

#####################################
## OpenJDK 8
## https://github.com/AdoptOpenJDK/openjdk-docker/tree/master/8/jdk/ubuntu
#####################################

ENV JDK8_ESUM=0949505fcf42a1765558048451bb2a22e84b3635b1a31dd6191780eeccaa4ada
ENV JDK8_VERSION=jdk8u292-b10
ENV JDK8_FILE=OpenJDK8U-jdk_x64_linux_hotspot_8u292b10.tar.gz

RUN curl -fsSL https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/${JDK8_VERSION}/${JDK8_FILE} -o /tmp/${JDK8_FILE} \
    #&& sha256sum /tmp/${JDK8_FILE} \
    && echo "${JDK8_ESUM}  /tmp/${JDK8_FILE}" | sha256sum -c -

#####################################
## NEXUS
## https://help.sonatype.com/repomanager3/release-notes
## https://help.sonatype.com/repomanager3/download/download-archives---repository-manager-3
#####################################

ARG NEXUS_VERSION=3.41.0-01
ARG NEXUS_CHECKSUM=ce265e627a665f9e833bf9c6e15a58c739882eb753863062f9e42e83e6f0d844

RUN curl -fsSL https://download.sonatype.com/nexus/3/nexus-${NEXUS_VERSION}-unix.tar.gz -o /tmp/nexus-${NEXUS_VERSION}-unix.tar.gz \
    #&& sha256sum /tmp/nexus-${NEXUS_VERSION}-unix.tar.gz \
    && echo "${NEXUS_CHECKSUM}  /tmp/nexus-${NEXUS_VERSION}-unix.tar.gz" | sha256sum -c -

#####################################
## WAIT-FOR
## https://github.com/eficode/wait-for
#####################################

ARG WAITFOR_VERSION=2.2.1
ARG WAITFOR_CHECKSUM=e38cb3073a844983aee8780a34959a293dad27006f95ec4e249ef81ded057ca1

RUN curl -fsSL https://github.com/eficode/wait-for/releases/download/v${WAITFOR_VERSION}/wait-for -o /tmp/wait-for \
    #&& sha256sum /tmp/wait-for \
    && echo "${WAITFOR_CHECKSUM}  /tmp/wait-for" | sha256sum -c -
 
#####################################
## NEW FOR INFRASTRUCTURE
#####################################

#####################################
## Apt Keys
#####################################

RUN curl -fsSL http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc -o /tmp/postgres-ACCC4CF8.asc \
    && curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /tmp/docker-gpg \
    && curl -fsSL https://packages.microsoft.com/keys/microsoft.asc -o /tmp/microsoft.asc

#####################################
## OpenJDK 11
#####################################

ENV JDK11_ESUM=e99b98f851541202ab64401594901e583b764e368814320eba442095251e78cb
ENV JDK11_VERSION=jdk-11.0.11%2B9
ENV JDK11_FILE=OpenJDK11U-jdk_x64_linux_hotspot_11.0.11_9.tar.gz
 
RUN curl -fsSL https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/${JDK11_VERSION}/${JDK11_FILE} -o /tmp/${JDK11_FILE} \
    && echo "${JDK11_ESUM}  /tmp/${JDK11_FILE}" | sha256sum -c -

#####################################
## OpenJDK 12
#####################################

ENV JDK12_ESUM=1202f536984c28d68681d51207a84b6c76e5998579132d3fe1b8085aa6a5f21e
ENV JDK12_VERSION=jdk-12.0.2%2B10
ENV JDK12_FILE=OpenJDK12U-jdk_x64_linux_hotspot_12.0.2_10.tar.gz

RUN curl -fsSL https://github.com/AdoptOpenJDK/openjdk12-binaries/releases/download/${JDK12_VERSION}/${JDK12_FILE} -o /tmp/${JDK12_FILE} \
    && echo "${JDK12_ESUM}  /tmp/${JDK12_FILE}" | sha256sum -c -

###############################################################
## Jenkins
## https://www.jenkins.io/download/
###############################################################

ENV JENKINS_VERSION=2.346.3
ENV JENKINS_SHA=141e8c5890a31a5cf37a970ce3e15273c1c74d8759e4a5873bb5511c50b47d89

RUN curl -fsSL https://repo.jenkins-ci.org/public/org/jenkins-ci/main/jenkins-war/${JENKINS_VERSION}/jenkins-war-${JENKINS_VERSION}.war -o /tmp/jenkins-war-${JENKINS_VERSION}.war \
    && echo "${JENKINS_SHA}  /tmp/jenkins-war-${JENKINS_VERSION}.war" | sha256sum -c -

ENV PLUGINMANAGER_VERSION=2.1.0
ENV PLUGINMANAGER_SHA=876ede1877687c5393d7cf63c688c44b329b39bb62c606cb4049c373fd75e6af

RUN curl -fsSL https://github.com/jenkinsci/plugin-installation-manager-tool/releases/download/${PLUGINMANAGER_VERSION}/jenkins-plugin-manager-${PLUGINMANAGER_VERSION}.jar -o /tmp/jenkins-plugin-manager-${PLUGINMANAGER_VERSION}.jar \
    && echo "${PLUGINMANAGER_SHA}  /tmp/jenkins-plugin-manager-${PLUGINMANAGER_VERSION}.jar" | sha256sum -c -


###############################################################
## Apache Maven
###############################################################

ENV MAVEN3_VERSION=3.8.6
ENV MAVEN3_SHA=c7047a48deb626abf26f71ab3643d296db9b1e67f1faa7d988637deac876b5a9

RUN curl -fsSL https://downloads.apache.org/maven/maven-3/${MAVEN3_VERSION}/binaries/apache-maven-${MAVEN3_VERSION}-bin.tar.gz -o /tmp/apache-maven-${MAVEN3_VERSION}-bin.tar.gz \
    && sha256sum /tmp/apache-maven-${MAVEN3_VERSION}-bin.tar.gz \
    && echo "${MAVEN3_SHA}  /tmp/apache-maven-${MAVEN3_VERSION}-bin.tar.gz" | sha256sum -c -

###############################################################
## Tini
## https://github.com/krallin/tini
###############################################################

ENV TINI_VERSION=v0.19.0
ENV TINI_SHA=93dcc18adc78c65a028a84799ecf8ad40c936fdfc5f2a57b1acda5a8117fa82c

RUN curl -fsSL https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini -o /tmp/tini \
    && echo "${TINI_SHA}  /tmp/tini" | sha256sum -c -

#####################################
## Docker
#####################################

ENV DOCKER_COMPOSE_VERSION=1.29.2
ENV DOCKER_COMPOSE_SHA=f3f10cf3dbb8107e9ba2ea5f23c1d2159ff7321d16f0a23051d68d8e2547b323

RUN curl -fsSL https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-Linux-x86_64 -o /tmp/docker-compose-${DOCKER_COMPOSE_VERSION} \
    && sha256sum /tmp/docker-compose-${DOCKER_COMPOSE_VERSION} \
    && echo "${DOCKER_COMPOSE_SHA}  /tmp/docker-compose-${DOCKER_COMPOSE_VERSION}" | sha256sum -c -

ENV DOCKER_VERSION=20.10.5
ENV DOCKER_SHA=3f18edc66e1faae607d428349e77f9800bdea554528521f0f6c49fc3f1de6abf

RUN curl -fsSL https://download.docker.com/linux/static/stable/x86_64/docker-${DOCKER_VERSION}.tgz -o /tmp/docker-${DOCKER_VERSION}.tgz \
    && sha256sum /tmp/docker-${DOCKER_VERSION}.tgz \
    && echo "${DOCKER_SHA}  /tmp/docker-${DOCKER_VERSION}.tgz" | sha256sum -c -

###############################################################
## Bitbucket 7.21.3
## https://www.atlassian.com/software/bitbucket/download-archives
###############################################################

ENV BITBUCKET_VERSION=7.21.3
ENV BITBUCKET_SHA=b7d54178ec896d6e7379da193e2deaba13428b939f9d0d20603538c382de2ae9

RUN curl -fsSL https://product-downloads.atlassian.com/software/stash/downloads/atlassian-bitbucket-${BITBUCKET_VERSION}.tar.gz -o /tmp/atlassian-bitbucket-${BITBUCKET_VERSION}.tar.gz \
    && sha256sum /tmp/atlassian-bitbucket-${BITBUCKET_VERSION}.tar.gz \
    && echo "${BITBUCKET_SHA}  /tmp/atlassian-bitbucket-${BITBUCKET_VERSION}.tar.gz" | sha256sum -c -

#####################################
## EHCACHE
#####################################

ENV EHCACHE_VERSION=3.8.0
ENV EHCACHE_SHA=b727283d66dbd2e616829cce33446965f73358026904542c234f5350a23abab4

RUN curl -fsSL https://github.com/ehcache/ehcache3/releases/download/v${EHCACHE_VERSION}/ehcache-clustered-${EHCACHE_VERSION}-kit.tgz -o /tmp/ehcache-clustered-${EHCACHE_VERSION}-kit.tgz \
    && sha256sum /tmp/ehcache-clustered-${EHCACHE_VERSION}-kit.tgz \
    && echo "${EHCACHE_SHA}  /tmp/ehcache-clustered-${EHCACHE_VERSION}-kit.tgz" | sha256sum -c -

ENV EHCACHE_VERSION=3.10.0
ENV EHCACHE_SHA=8a3048b895386de93b5e476826d3c607b74b914a495104e98c3e5ee48c1fd94f

RUN curl -fsSL https://github.com/ehcache/ehcache3/releases/download/v${EHCACHE_VERSION}/ehcache-clustered-${EHCACHE_VERSION}-kit.tgz -o /tmp/ehcache-clustered-${EHCACHE_VERSION}-kit.tgz \
    && sha256sum /tmp/ehcache-clustered-${EHCACHE_VERSION}-kit.tgz \
    && echo "${EHCACHE_SHA}  /tmp/ehcache-clustered-${EHCACHE_VERSION}-kit.tgz" | sha256sum -c -


#####################################
## SONARQUBE
## https://binaries.sonarsource.com/Distribution/sonarqube/
#####################################

ENV SONARQUBE_VERSION=9.6.0.59041
ENV SONARQUBE_ZIP_URL=https://binaries.sonarsource.com/Distribution/sonarqube/sonarqube-${SONARQUBE_VERSION}.zip
RUN SONARQUBE_SHA=$(curl -sl ${SONARQUBE_ZIP_URL}.sha256) \
    && curl -fsSL ${SONARQUBE_ZIP_URL} -o /tmp/sonarqube-${SONARQUBE_VERSION}.zip \
    && echo "${SONARQUBE_SHA}  /tmp/sonarqube-${SONARQUBE_VERSION}.zip" | sha256sum -c -


###############################################################
## Append new Files to download here
###############################################################

# ensures that we leverage images caches

###############################################################
## DONE with files
###############################################################

# simply log out everything downloaded
RUN ls /tmp/*

COPY init.sh /init.sh
RUN chmod +x init.sh \
    && dos2unix init.sh

CMD ["./init.sh"]
#!/bin/bash

uploadIfNotExists() {

    echo $1
    echo $2
    echo $3

    # $1 src
    # $2 destination
    # $3 mame

    if curl --output /dev/null --silent --fail -r 0-0 "${NEXUS_BASE_URL}$2"; then
        echo "$3 exists skipping."
    else
        curl -v --upload-file $1 ${NEXUS_BASE_URL}$2
    fi 

}

uploadKeyIfNotExists() {

    echo $1
    echo $2
    echo $3

    # $1 src
    # $2 destination
    # $3 mame

    if curl --output /dev/null --silent --fail -r 0-0 "${NEXUS_KEYS_BASE_URL}$2"; then
        echo "$3 exists skipping."
    else
        curl -v --upload-file $1 ${NEXUS_KEYS_BASE_URL}$2
    fi 

}

# fail if anything errors
set -e

NEXUS_BASE_URL=${ARG_ART_URL}/repository/dml/docker
NEXUS_KEYS_BASE_URL=${ARG_ART_URL}/repository/apt-keys

#####################################
## SEED REPEAT
#####################################

BUILD_INFO_FOCAL=20211006
uploadIfNotExists /tmp/ubuntu-focal/build-info.txt /ubuntu/focal/${BUILD_INFO_FOCAL}/build-info.txt  "ubuntu-buildinfo"
uploadIfNotExists /tmp/ubuntu-focal/SHA256SUMS /ubuntu/focal/${BUILD_INFO_FOCAL}/SHA256SUMS "ubuntu-shasums"
uploadIfNotExists /tmp/ubuntu-focal/ubuntu-focal-oci-amd64-root.tar.gz /ubuntu/focal/${BUILD_INFO_FOCAL}/ubuntu-focal-oci-amd64-root.tar.gz  "ubuntu-tar"
uploadIfNotExists /tmp/ubuntu-focal/ubuntu-focal-oci-amd64.manifest /ubuntu/focal/${BUILD_INFO_FOCAL}/ubuntu-focal-oci-amd64.manifest  "ubuntu-manifest"

JDK8_VERSION=jdk8u292-b10
JDK8_FILE=OpenJDK8U-jdk_x64_linux_hotspot_8u292b10.tar.gz
uploadIfNotExists /tmp/${JDK8_FILE} /jdk/${JDK8_VERSION}/${JDK8_FILE} "jdk8"

NEXUS_VERSION=3.41.0-01
uploadIfNotExists /tmp/nexus-${NEXUS_VERSION}-unix.tar.gz /nexus/nexus-${NEXUS_VERSION}-unix.tar.gz "nexus3"

uploadIfNotExists /tmp/wait-for /tools/wait-for "wait-for"

#####################################
## Apt Keys
#####################################

uploadKeyIfNotExists /tmp/postgres-ACCC4CF8.asc /postgres/ACCC4CF8.asc "postgres"
uploadKeyIfNotExists /tmp/docker-gpg /docker/gpg "docker"
uploadKeyIfNotExists /tmp/microsoft.asc /microsoft/microsoft.asc "microsoft"

JDK11_VERSION=jdk-11.0.11%2B9
JDK11_FILE=OpenJDK11U-jdk_x64_linux_hotspot_11.0.11_9.tar.gz
uploadIfNotExists /tmp/${JDK11_FILE} /jdk/${JDK11_VERSION}/${JDK11_FILE} "jdk11"

JDK12_VERSION=jdk-12.0.2%2B10
JDK12_FILE=OpenJDK12U-jdk_x64_linux_hotspot_12.0.2_10.tar.gz
uploadIfNotExists /tmp/${JDK12_FILE} /jdk/${JDK12_VERSION}/${JDK12_FILE} "jdk12"

JENKINS_VERSION=2.346.3
uploadIfNotExists /tmp/jenkins-war-${JENKINS_VERSION}.war /jenkins/jenkins-war-${JENKINS_VERSION}.war "jenkins"

PLUGINMANAGER_VERSION=2.1.0
uploadIfNotExists /tmp/jenkins-plugin-manager-${PLUGINMANAGER_VERSION}.jar /jenkins/jenkins-plugin-manager-${PLUGINMANAGER_VERSION}.jar "jenkins-plugin-manager"

MAVEN3_VERSION=3.8.6
uploadIfNotExists /tmp/apache-maven-${MAVEN3_VERSION}-bin.tar.gz /maven/apache-maven-${MAVEN3_VERSION}-bin.tar.gz "maven"

uploadIfNotExists /tmp/tini /tools/tini "tini"

DOCKER_COMPOSE_VERSION=1.29.2
uploadIfNotExists /tmp/docker-compose-${DOCKER_COMPOSE_VERSION} /docker/docker-compose-${DOCKER_COMPOSE_VERSION} "docker-compose"

DOCKER_VERSION=20.10.5
uploadIfNotExists /tmp/docker-${DOCKER_VERSION}.tgz /docker/docker-${DOCKER_VERSION}.tgz "docker"

BITBUCKET_VERSION=7.21.3
uploadIfNotExists /tmp/atlassian-bitbucket-${BITBUCKET_VERSION}.tar.gz /bitbucket/atlassian-bitbucket-${BITBUCKET_VERSION}.tar.gz "bitbucket-${BITBUCKET_VERSION}"

EHCACHE_VERSION=3.8.0
uploadIfNotExists /tmp/ehcache-clustered-${EHCACHE_VERSION}-kit.tgz /ehcache/ehcache-clustered-${EHCACHE_VERSION}-kit.tgz "ehcache"

EHCACHE_VERSION=3.10.0
uploadIfNotExists /tmp/ehcache-clustered-${EHCACHE_VERSION}-kit.tgz /ehcache/ehcache-clustered-${EHCACHE_VERSION}-kit.tgz "ehcache"

SONARQUBE_VERSION=9.6.0.59041
uploadIfNotExists /tmp/sonarqube-${SONARQUBE_VERSION}.zip /sonarqube/sonarqube-${SONARQUBE_VERSION}.zip "sonarqube"

Just as we did on our initial seed DML image, we leverage docker for process management but also include the downloaded binaries as well. Running the DML upload is simply done via the our compose file, this time around running against the running Nexus3 instance and not as a side car as we did during initialization.

labcomposed
version: '3.3'

services:
  nexus-dml:
    image: infra/dml:1.0.0
    environment:
      - ARG_ART_URL=http://d1i-doc-ngbuild:3001
    networks:
      - ops-network
networks:
  ops-network:
    name: ops-network

Build, run, publish.

docker-compose -f images/nexus-dml/docker-compose.yml build
docker-compose -f composed/docker-compose-dml.yml up

#docker login docker-private.acme.com
images/docker-push.sh infra/dml:1.0.0 docker-private.acme.com

Depending on the number of artifacts you are managing, this image could get quite large. Treating the download and upload process as a docker image is entirely optional. We prefer it as a docker build file (and this image) to enforce standards for process management that can be verified during code reviews and finally have another place to get the file from in case you have no internet access or the file is no longer available.

DML Image Changes

In the scenario that new binaries or artifacts have to be added to your DML, we follow an append approach via these steps:

  1. (Optional) Pull the latest Version of the file for build caching
  2. Append new file downloads/uploads to the existing Dockerfile and init.sh at the end
  3. Rebuild it and Rerun it
  4. Push it back into registry

We generally collapse appends after some time to remove old artifacts, and rebuild the entire image without caching. While this will redownload every single file, it serves as another verification step. Any failures for existing files that you are downloading during the build process will give you a heads up that third party files may no longer be available in the future. Remember, you have a copy of the files both in your DML and your docker images.