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 c99b0fb CDN-in-a-Box now caches Carton dependencies by default (#3733)
c99b0fb is described below
commit c99b0fb3bff309f61166b335309917413cf46e5e
Author: ocket8888 <[email protected]>
AuthorDate: Fri Sep 6 16:30:07 2019 -0600
CDN-in-a-Box now caches Carton dependencies by default (#3733)
* CDN-in-a-Box now caches Carton dependencies by default
* pre-installing goose as well, now
---
infrastructure/cdn-in-a-box/docker-compose.yml | 6 +-
infrastructure/cdn-in-a-box/traffic_ops/Dockerfile | 93 +++++++++++++---------
.../cdn-in-a-box/traffic_ops/Dockerfile-go | 13 ++-
3 files changed, 63 insertions(+), 49 deletions(-)
diff --git a/infrastructure/cdn-in-a-box/docker-compose.yml
b/infrastructure/cdn-in-a-box/docker-compose.yml
index cfbc774..82039b8 100644
--- a/infrastructure/cdn-in-a-box/docker-compose.yml
+++ b/infrastructure/cdn-in-a-box/docker-compose.yml
@@ -78,10 +78,10 @@ services:
# in place until all API endpoints have been rewritten in Go
trafficops-perl:
build:
- context: .
- dockerfile: traffic_ops/Dockerfile
+ context: ../..
+ dockerfile: infrastructure/cdn-in-a-box/traffic_ops/Dockerfile
args:
- TRAFFIC_OPS_RPM: traffic_ops/traffic_ops.rpm
+ TRAFFIC_OPS_RPM:
infrastructure/cdn-in-a-box/traffic_ops/traffic_ops.rpm
depends_on:
- db
- enroller
diff --git a/infrastructure/cdn-in-a-box/traffic_ops/Dockerfile
b/infrastructure/cdn-in-a-box/traffic_ops/Dockerfile
index 59f4295..f4c2e68 100644
--- a/infrastructure/cdn-in-a-box/traffic_ops/Dockerfile
+++ b/infrastructure/cdn-in-a-box/traffic_ops/Dockerfile
@@ -23,6 +23,9 @@
FROM centos:7
+EXPOSE 443
+ENV MOJO_MODE production
+
RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 && \
rpm --import https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7 && \
rpm --import
https://download.postgresql.org/pub/repos/yum/RPM-GPG-KEY-PGDG && \
@@ -31,63 +34,75 @@ RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 && \
yum install -y \
epel-release \
pgdg-redhat-latest && \
- yum -y clean all
-
-RUN yum install -y \
- cpanminus \
+ yum install -y \
bind-utils \
- net-tools \
+ cpanminus \
+ expat-devel \
+ gcc-c++ \
gettext \
+ git \
golang \
+ iproute \
+ jq \
+ libcurl \
+ libcurl-devel \
+ libidn-devel \
+ libpcap-devel \
+ mkisofs \
+ net-tools \
nmap-ncat \
openssl \
+ openssl-devel \
perl \
+ perl-core \
perl-Crypt-ScryptKDF \
- perl-Test-CPAN-Meta \
+ perl-DBD-Pg \
+ perl-DBI \
+ perl-DBIx-Connector \
+ perl-Digest-SHA1 \
+ perl-JSON \
perl-JSON-PP \
- git \
- iproute \
- jq && \
+ perl-libwww-perl \
+ perl-TermReadKey \
+ perl-Test-CPAN-Meta \
+ perl-WWW-Curl \
+ postgresql96 \
+ postgresql96-devel \
+ postgresql96-libs \
+ tar &&\
yum -y clean all
-RUN yum install -y perl-DBIx-Connector
+ADD https://geolite.maxmind.com/download/geoip/database/GeoLite2-City.tar.gz /
+
+WORKDIR /opt/traffic_ops/app
+ADD traffic_ops/app/cpanfile traffic_ops/install/bin/install_goose.sh ./
+RUN cpanm -l ./local Carton && \
+ POSTGRES_HOME=/usr/pgsql-9.6 PERL5LIB=$(pwd)/local/lib/perl5
./local/bin/carton && \
+ rm -rf $HOME/.cpan* /tmp/Dockerfile /tmp/local.tar.gz ./cpanfile &&
./install_goose.sh
# 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=traffic_ops/traffic_ops.rpm
+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) \
- rm /$(basename $TRAFFIC_OPS_RPM) && \
- yum clean all
-
-# copy any dir structure in overrides to TO -- allows modification of the
install and shortcut to get perl modules/goose installed
-WORKDIR /opt/traffic_ops/app
-COPY traffic_ops/overrides/ /opt/traffic_ops/.
-RUN cpanm -l ./local Carton
+RUN yum install -y /$(basename $TRAFFIC_OPS_RPM) && \
+ rm /$(basename $TRAFFIC_OPS_RPM) && \
+ yum -y clean all
-# run carton whether or not local dir was installed
+# Run carton again, in case the cpanfile included in the RPM differs from the
one used earlier in the
+# build (should never happen - Perl is supposed to be going away)
RUN POSTGRES_HOME=/usr/pgsql-9.6 PERL5LIB=$(pwd)/local/lib/perl5
./local/bin/carton && \
- rm -rf $HOME/.cpan* /tmp/Dockerfile /tmp/local.tar.gz
-
-RUN /opt/traffic_ops/install/bin/install_goose.sh
-
-ADD https://geolite.maxmind.com/download/geoip/database/GeoLite2-City.tar.gz /
-
-EXPOSE 443
-WORKDIR /opt/traffic_ops/app
-ENV MOJO_MODE production
+ rm -rf $HOME/.cpan* /tmp/Dockerfile /tmp/local.tar.gz
-ADD enroller/server_template.json \
- traffic_ops/run.sh \
- traffic_ops/config.sh \
- traffic_ops/adduser.pl \
- traffic_ops/to-access.sh \
- traffic_ops/generate-certs.sh \
- traffic_ops/trafficops-init.sh \
- variables.env \
+ADD infrastructure/cdn-in-a-box/enroller/server_template.json \
+ infrastructure/cdn-in-a-box/traffic_ops/run.sh \
+ infrastructure/cdn-in-a-box/traffic_ops/config.sh \
+ infrastructure/cdn-in-a-box/traffic_ops/adduser.pl \
+ infrastructure/cdn-in-a-box/traffic_ops/to-access.sh \
+ infrastructure/cdn-in-a-box/traffic_ops/generate-certs.sh \
+ infrastructure/cdn-in-a-box/traffic_ops/trafficops-init.sh \
+ infrastructure/cdn-in-a-box/variables.env \
/
-ADD traffic_ops_data /traffic_ops_data
+ADD infrastructure/cdn-in-a-box/traffic_ops_data /traffic_ops_data
RUN chown -R trafops:trafops /opt/traffic_ops
CMD /run.sh
diff --git a/infrastructure/cdn-in-a-box/traffic_ops/Dockerfile-go
b/infrastructure/cdn-in-a-box/traffic_ops/Dockerfile-go
index 8750afb..13d5070 100644
--- a/infrastructure/cdn-in-a-box/traffic_ops/Dockerfile-go
+++ b/infrastructure/cdn-in-a-box/traffic_ops/Dockerfile-go
@@ -22,16 +22,15 @@
FROM centos:7
-RUN yum -y install nmap-ncat openssl epel-release
-RUN yum -y install jq && yum clean all
-
-RUN mkdir -p /opt/traffic_ops/app/bin /opt/traffic_ops/app/conf/production
/opt/traffic_ops/app/db
-COPY --from=trafficops-perl /opt/traffic_ops/app/bin/traffic_ops_golang
/opt/traffic_ops/app/bin/traffic_ops_golang
-COPY --from=trafficops-perl /opt/traffic_ops/app/conf/
/opt/traffic_ops/app/conf
+RUN yum -y install epel-release && \
+ yum -y install jq bind-utils net-tools gettext perl-JSON-PP nmap-ncat
openssl && \
+ yum clean all
EXPOSE 443
WORKDIR /opt/traffic_ops/app
-RUN yum install -y bind-utils net-tools gettext perl-JSON-PP
+
+COPY --from=trafficops-perl /opt/traffic_ops/app/bin/traffic_ops_golang
/opt/traffic_ops/app/bin/traffic_ops_golang
+COPY --from=trafficops-perl /opt/traffic_ops/app/conf/
/opt/traffic_ops/app/conf/
ADD enroller/server_template.json \