This is an automated email from the ASF dual-hosted git repository.
mitchell852 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git
The following commit(s) were added to refs/heads/master by this push:
new 9f56bae CDN-in-a-Box image rebuilding speedups (#4823)
9f56bae is described below
commit 9f56bae962025e3d5ebb9b7fb7a1039b222866f1
Author: Zach Hoffman <[email protected]>
AuthorDate: Tue Jun 30 21:33:32 2020 +0000
CDN-in-a-Box image rebuilding speedups (#4823)
* Move the component RPM install to a separate layer in Traffic Monitor
and Traffic Portal CDN-in-a-Box images
* Install Tomcat Native dependency before installing Traffic Router and
Tomcat
* Install Devel::Camelcadedb in Traffic Ops Perl's existing local::lib
* Consistent whitespace
* Move the Traffic Stats RPM install to a separate layer after
dependencies are installed
---
infrastructure/cdn-in-a-box/traffic_monitor/Dockerfile | 7 ++++---
infrastructure/cdn-in-a-box/traffic_ops/Dockerfile-debug | 4 +---
infrastructure/cdn-in-a-box/traffic_portal/Dockerfile | 9 +++++----
infrastructure/cdn-in-a-box/traffic_router/Dockerfile | 12 ++++++------
infrastructure/cdn-in-a-box/traffic_stats/Dockerfile | 8 +++++---
5 files changed, 21 insertions(+), 19 deletions(-)
diff --git a/infrastructure/cdn-in-a-box/traffic_monitor/Dockerfile
b/infrastructure/cdn-in-a-box/traffic_monitor/Dockerfile
index 2e63309..5c16c6a 100644
--- a/infrastructure/cdn-in-a-box/traffic_monitor/Dockerfile
+++ b/infrastructure/cdn-in-a-box/traffic_monitor/Dockerfile
@@ -23,7 +23,6 @@ FROM centos/systemd
# Default values for RPM -- override with `docker build --build-arg RPM=...'
ARG RPM=traffic_monitor/traffic_monitor.rpm
-ADD $RPM /
RUN yum install -y epel-release && \
yum install -y \
@@ -35,10 +34,12 @@ RUN yum install -y epel-release && \
bind-utils \
openssl \
initscripts && \
- yum install -y /$(basename $RPM) && \
- rm /$(basename $RPM) && \
yum clean all
+ADD $RPM /
+RUN yum install -y /$(basename $RPM) && \
+ rm /$(basename $RPM)
+
RUN mkdir -p /opt/traffic_monitor/conf
ADD traffic_monitor/traffic_monitor.cfg
/opt/traffic_monitor/conf/traffic_monitor.cfg.template
diff --git a/infrastructure/cdn-in-a-box/traffic_ops/Dockerfile-debug
b/infrastructure/cdn-in-a-box/traffic_ops/Dockerfile-debug
index e39d87b..e62b474 100644
--- a/infrastructure/cdn-in-a-box/traffic_ops/Dockerfile-debug
+++ b/infrastructure/cdn-in-a-box/traffic_ops/Dockerfile-debug
@@ -22,7 +22,5 @@
FROM trafficops-perl
-RUN cpanm \
- Test::More \
- Devel::Camelcadedb && \
+RUN cpanm -l ./local Carton Devel::Camelcadedb && \
rm -r /root/.cpanm
diff --git a/infrastructure/cdn-in-a-box/traffic_portal/Dockerfile
b/infrastructure/cdn-in-a-box/traffic_portal/Dockerfile
index 9f66e9d..024b1bc 100644
--- a/infrastructure/cdn-in-a-box/traffic_portal/Dockerfile
+++ b/infrastructure/cdn-in-a-box/traffic_portal/Dockerfile
@@ -26,7 +26,6 @@ RUN curl -sL https://rpm.nodesource.com/setup_12.x | bash -
# Override TRAFFIC_PORTAL_RPM arg to use a different one using --build-arg
TRAFFIC_PORTAL_RPM=... Can be local file or http://...
ARG TRAFFIC_PORTAL_RPM=traffic_portal/traffic_portal.rpm
-ADD $TRAFFIC_PORTAL_RPM /
ARG TO_HOST=$TO_HOST
@@ -39,12 +38,14 @@ RUN yum install -y \
openssl \
gettext \
bind-utils \
- net-tools \
- /$(basename $TRAFFIC_PORTAL_RPM) && \
- rm /$(basename $TRAFFIC_PORTAL_RPM) && \
+ net-tools && \
yum clean all || \
echo "ERROR INSTALLING PACKAGES"
+ADD $TRAFFIC_PORTAL_RPM /
+RUN yum install -y /$(basename $TRAFFIC_PORTAL_RPM) && \
+ rm /$(basename $TRAFFIC_PORTAL_RPM)
+
ADD enroller/server_template.json \
traffic_portal/run.sh \
traffic_ops/to-access.sh /
diff --git a/infrastructure/cdn-in-a-box/traffic_router/Dockerfile
b/infrastructure/cdn-in-a-box/traffic_router/Dockerfile
index 9e790c8..6741764 100644
--- a/infrastructure/cdn-in-a-box/traffic_router/Dockerfile
+++ b/infrastructure/cdn-in-a-box/traffic_router/Dockerfile
@@ -26,19 +26,19 @@ MAINTAINER [email protected]
ARG TRAFFIC_ROUTER_RPM=traffic_router/traffic_router.rpm
ARG TOMCAT_RPM=traffic_router/tomcat.rpm
-RUN yum -y install epel-release git rpm-build net-tools iproute nc wget tar
unzip \
+RUN yum -y install epel-release && \
+ yum -y install git rpm-build net-tools iproute nc wget tar unzip \
perl-JSON perl-WWWCurl which make autoconf automake gcc gcc-c++ apr
apr-devel \
openssl openssl-devel bind-utils net-tools perl-JSON-PP gettext \
- java-1.8.0-openjdk-headless java-1.8.0-openjdk-devel && \
+ java-1.8.0-openjdk-headless java-1.8.0-openjdk-devel tomcat-native
&& \
yum -y clean all && \
- ln -sfv $(find /usr/lib/jvm -type d -name 'java-1.8.0*openjdk*') /opt/java
+ ln -sfv $(realpath /usr/lib/jvm/java-1.8.0) /opt/java
ADD $TRAFFIC_ROUTER_RPM /traffic_router.rpm
ADD $TOMCAT_RPM /tomcat.rpm
-RUN yum -y install /traffic_router.rpm /tomcat.rpm
-
-RUN find /usr/lib* -name libtc\* -exec ln -sfv '{}' /opt/tomcat/lib \;
+RUN yum -y install /traffic_router.rpm /tomcat.rpm && \
+ find /usr/lib* -name libtc\* -exec ln -sfv {} /opt/tomcat/lib \;
ADD enroller/server_template.json \
traffic_router/run.sh \
diff --git a/infrastructure/cdn-in-a-box/traffic_stats/Dockerfile
b/infrastructure/cdn-in-a-box/traffic_stats/Dockerfile
index 952ddca..99bbb79 100644
--- a/infrastructure/cdn-in-a-box/traffic_stats/Dockerfile
+++ b/infrastructure/cdn-in-a-box/traffic_stats/Dockerfile
@@ -23,19 +23,21 @@ FROM centos:7
# Default values for RPM -- override with `docker build --build-arg RPM=...'
ARG TRAFFIC_TS_RPM=traffic_stats/traffic_stats.rpm
-ADD $TRAFFIC_TS_RPM /
RUN yum install -y epel-release && \
- yum install -y /$(basename $TRAFFIC_TS_RPM) \
+ yum install -y \
jq \
nmap-ncat \
net-tools \
gettext \
bind-utils \
openssl && \
- rm /$(basename $TRAFFIC_TS_RPM) && \
yum clean all
+ADD $TRAFFIC_TS_RPM /
+RUN yum install -y /$(basename $TRAFFIC_TS_RPM) \
+ rm /$(basename $TRAFFIC_TS_RPM)
+
ADD enroller/server_template.json \
traffic_ops/to-access.sh \
traffic_stats/run.sh \