From 954446784861a2f7601cbc48a1038bc50f3b8184 Mon Sep 17 00:00:00 2001 From: Zach Hoffman Date: Sun, 26 Jul 2020 22:35:27 -0600 Subject: [PATCH 1/2] Use rpm command instead of yum to install ATC RPMs to avoid fetching repo metadata that will go unused --- infrastructure/cdn-in-a-box/cache/Dockerfile | 7 +++---- infrastructure/cdn-in-a-box/traffic_ops/Dockerfile | 3 +-- infrastructure/cdn-in-a-box/traffic_ops/Dockerfile-go | 2 +- infrastructure/cdn-in-a-box/traffic_portal/Dockerfile | 2 +- infrastructure/cdn-in-a-box/traffic_router/Dockerfile | 2 +- infrastructure/cdn-in-a-box/traffic_stats/Dockerfile | 2 +- 6 files changed, 8 insertions(+), 10 deletions(-) diff --git a/infrastructure/cdn-in-a-box/cache/Dockerfile b/infrastructure/cdn-in-a-box/cache/Dockerfile index eac568dbb4..a8de4c2860 100644 --- a/infrastructure/cdn-in-a-box/cache/Dockerfile +++ b/infrastructure/cdn-in-a-box/cache/Dockerfile @@ -29,7 +29,7 @@ EXPOSE 80 ADD https://ci.trafficserver.apache.org/RPMS/CentOS7/trafficserver-7.1.4-2.el7.x86_64.rpm /trafficserver.rpm ADD https://ci.trafficserver.apache.org/RPMS/CentOS7/trafficserver-devel-7.1.4-2.el7.x86_64.rpm /trafficserver-devel.rpm -RUN yum install -y bind-utils kyotocabinet-libs epel-release initscripts iproute net-tools nmap-ncat gettext autoconf automake libtool gcc-c++ cronie glibc-devel openssl-devel +RUN yum install -y bind-utils kyotocabinet-libs epel-release initscripts iproute net-tools nmap-ncat gettext autoconf automake libtool gcc-c++ cronie glibc-devel openssl-devel 'perl(JSON)' RUN yum install -y /trafficserver.rpm /trafficserver-devel.rpm jq python36-psutil python36-typing python36-setuptools python36-pip logrotate && yum clean all RUN python3 -m pip install --upgrade pip && python3 -m pip install requests urllib3 distro @@ -67,8 +67,7 @@ ADD infrastructure/cdn-in-a-box/cache/run.sh infrastructure/cdn-in-a-box/traffic ARG ORT_RPM=infrastructure/cdn-in-a-box/cache/traffic_ops_ort.rpm ADD $ORT_RPM / -RUN yum install -y /$(basename $ORT_RPM) &&\ - rm /$(basename $ORT_RPM) && \ - yum -y clean all +RUN rpm -Uvh /$(basename $ORT_RPM) &&\ + rm /$(basename $ORT_RPM) CMD /run.sh diff --git a/infrastructure/cdn-in-a-box/traffic_ops/Dockerfile b/infrastructure/cdn-in-a-box/traffic_ops/Dockerfile index 4baba5ca60..c7fcc72ecb 100644 --- a/infrastructure/cdn-in-a-box/traffic_ops/Dockerfile +++ b/infrastructure/cdn-in-a-box/traffic_ops/Dockerfile @@ -88,9 +88,8 @@ FROM trafficops-perl-deps # Override TRAFFIC_OPS_RPM arg to use a different one using --build-arg TRAFFIC_OPS_RPM=... Can be local file or http://... ARG TRAFFIC_OPS_RPM=infrastructure/cdn-in-a-box/traffic_ops/traffic_ops.rpm ADD $TRAFFIC_OPS_RPM / -RUN yum install -y /$(basename $TRAFFIC_OPS_RPM) && \ +RUN rpm -Uvh /$(basename $TRAFFIC_OPS_RPM) && \ rm /$(basename $TRAFFIC_OPS_RPM) && \ - yum -y clean all && \ rm /opt/traffic_ops/app/bin/traffic_ops_golang # Run carton again, in case the cpanfile included in the RPM differs from the one used earlier in the diff --git a/infrastructure/cdn-in-a-box/traffic_ops/Dockerfile-go b/infrastructure/cdn-in-a-box/traffic_ops/Dockerfile-go index dcde0e9ade..2098b86d5f 100644 --- a/infrastructure/cdn-in-a-box/traffic_ops/Dockerfile-go +++ b/infrastructure/cdn-in-a-box/traffic_ops/Dockerfile-go @@ -49,7 +49,7 @@ ARG TRAFFIC_OPS_RPM=traffic_ops/traffic_ops.rpm COPY $TRAFFIC_OPS_RPM / RUN to_rpm_filename="$(basename $TRAFFIC_OPS_RPM)" && \ - rpm --install --nodeps --verbose --hash "$to_rpm_filename" && \ + rpm -Uvh --nodeps "$to_rpm_filename" && \ rm "$to_rpm_filename" COPY enroller/server_template.json \ diff --git a/infrastructure/cdn-in-a-box/traffic_portal/Dockerfile b/infrastructure/cdn-in-a-box/traffic_portal/Dockerfile index 403421472c..92435ea69f 100644 --- a/infrastructure/cdn-in-a-box/traffic_portal/Dockerfile +++ b/infrastructure/cdn-in-a-box/traffic_portal/Dockerfile @@ -43,7 +43,7 @@ RUN yum install -y \ echo "ERROR INSTALLING PACKAGES" ADD $TRAFFIC_PORTAL_RPM / -RUN yum install -y /$(basename $TRAFFIC_PORTAL_RPM) && \ +RUN rpm -Uvh /$(basename $TRAFFIC_PORTAL_RPM) && \ rm /$(basename $TRAFFIC_PORTAL_RPM) ADD enroller/server_template.json \ diff --git a/infrastructure/cdn-in-a-box/traffic_router/Dockerfile b/infrastructure/cdn-in-a-box/traffic_router/Dockerfile index 6350b923b5..ab411f851a 100644 --- a/infrastructure/cdn-in-a-box/traffic_router/Dockerfile +++ b/infrastructure/cdn-in-a-box/traffic_router/Dockerfile @@ -37,7 +37,7 @@ RUN yum -y install epel-release && \ ADD $TRAFFIC_ROUTER_RPM /traffic_router.rpm ADD $TOMCAT_RPM /tomcat.rpm -RUN yum -y install /traffic_router.rpm /tomcat.rpm && \ +RUN rpm -Uvh /traffic_router.rpm /tomcat.rpm && \ find /usr/lib* -name libtc\* -exec ln -sfv {} /opt/tomcat/lib \; ADD enroller/server_template.json \ diff --git a/infrastructure/cdn-in-a-box/traffic_stats/Dockerfile b/infrastructure/cdn-in-a-box/traffic_stats/Dockerfile index 99bbb795fc..011cbd103b 100644 --- a/infrastructure/cdn-in-a-box/traffic_stats/Dockerfile +++ b/infrastructure/cdn-in-a-box/traffic_stats/Dockerfile @@ -35,7 +35,7 @@ RUN yum install -y epel-release && \ yum clean all ADD $TRAFFIC_TS_RPM / -RUN yum install -y /$(basename $TRAFFIC_TS_RPM) \ +RUN rpm -Uvh /$(basename $TRAFFIC_TS_RPM) && \ rm /$(basename $TRAFFIC_TS_RPM) ADD enroller/server_template.json \ From af14af15b2fcf5e7168f9c1f22b313bfbdca07f6 Mon Sep 17 00:00:00 2001 From: Zach Hoffman Date: Mon, 10 Aug 2020 12:43:01 -0600 Subject: [PATCH 2/2] Do not install Perl Traffic Ops ORT dependencies --- infrastructure/cdn-in-a-box/cache/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/infrastructure/cdn-in-a-box/cache/Dockerfile b/infrastructure/cdn-in-a-box/cache/Dockerfile index a8de4c2860..027d39154c 100644 --- a/infrastructure/cdn-in-a-box/cache/Dockerfile +++ b/infrastructure/cdn-in-a-box/cache/Dockerfile @@ -29,7 +29,7 @@ EXPOSE 80 ADD https://ci.trafficserver.apache.org/RPMS/CentOS7/trafficserver-7.1.4-2.el7.x86_64.rpm /trafficserver.rpm ADD https://ci.trafficserver.apache.org/RPMS/CentOS7/trafficserver-devel-7.1.4-2.el7.x86_64.rpm /trafficserver-devel.rpm -RUN yum install -y bind-utils kyotocabinet-libs epel-release initscripts iproute net-tools nmap-ncat gettext autoconf automake libtool gcc-c++ cronie glibc-devel openssl-devel 'perl(JSON)' +RUN yum install -y bind-utils kyotocabinet-libs epel-release initscripts iproute net-tools nmap-ncat gettext autoconf automake libtool gcc-c++ cronie glibc-devel openssl-devel RUN yum install -y /trafficserver.rpm /trafficserver-devel.rpm jq python36-psutil python36-typing python36-setuptools python36-pip logrotate && yum clean all RUN python3 -m pip install --upgrade pip && python3 -m pip install requests urllib3 distro @@ -67,7 +67,7 @@ ADD infrastructure/cdn-in-a-box/cache/run.sh infrastructure/cdn-in-a-box/traffic ARG ORT_RPM=infrastructure/cdn-in-a-box/cache/traffic_ops_ort.rpm ADD $ORT_RPM / -RUN rpm -Uvh /$(basename $ORT_RPM) &&\ +RUN rpm -Uvh --nodeps /$(basename $ORT_RPM) &&\ rm /$(basename $ORT_RPM) CMD /run.sh