zrhoffman commented on a change in pull request #5209:
URL: https://github.com/apache/trafficcontrol/pull/5209#discussion_r578034858
##########
File path: infrastructure/cdn-in-a-box/traffic_ops/Dockerfile
##########
@@ -20,129 +20,76 @@
# Based on CentOS 8
############################################################
-# Keep the trafficops-common-deps in Dockerfile the same as
-# trafficops-common-deps in Dockerfile-go to cache the same
-# layer.
ARG RHEL_VERSION=8
-FROM centos:${RHEL_VERSION} as trafficops-common-deps
+FROM centos:${RHEL_VERSION}
ARG RHEL_VERSION=8
# Makes RHEL_VERSION available in later layers without needing to specify it
again
ENV RHEL_VERSION=$RHEL_VERSION
RUN if [[ "${RHEL_VERSION%%.*}" -eq 7 ]]; then \
- yum -y install dnf || exit 1; \
- fi
+ yum -y install dnf || exit 1; \
+ fi
RUN set -o nounset -o errexit && \
- mkdir -p /etc/cron.d; \
- if [[ "${RHEL_VERSION%%.*}" -eq 7 ]]; then \
- use_repo=''; \
- else \
- use_repo='--repo=pgdg96'; \
- fi; \
- dnf -y install
"https://download.postgresql.org/pub/repos/yum/reporpms/EL-${RHEL_VERSION%%.*}-x86_64/pgdg-redhat-repo-latest.noarch.rpm";
\
- dnf -y $use_repo -- install postgresql96; \
- dnf -y install epel-release; \
- dnf -y install \
- jq \
- bind-utils \
- net-tools \
- gettext \
- perl-JSON-PP \
- mkisofs \
- isomd5sum \
- nmap-ncat \
- openssl \
- # Used to copy certs in "Shared SSL certificate generation" step
- rsync; \
- dnf clean all
-
-FROM trafficops-common-deps as trafficops-perl-deps
+ mkdir -p /etc/cron.d; \
+ if [[ "${RHEL_VERSION%%.*}" -eq 7 ]]; then \
+ use_repo=''; \
+ else \
+ use_repo='--repo=pgdg96'; \
+ fi; \
+ dnf -y install
"https://download.postgresql.org/pub/repos/yum/reporpms/EL-${RHEL_VERSION%%.*}-x86_64/pgdg-redhat-repo-latest.noarch.rpm";
\
+ dnf -y $use_repo -- install postgresql96; \
+ dnf -y install epel-release; \
+ dnf -y install \
+ jq \
+ bind-utils \
+ net-tools \
+ gettext \
+ perl-JSON-PP \
+ perl-Crypt-ScryptKDF \
+ mkisofs \
+ isomd5sum \
+ nmap-ncat \
+ openssl \
+ python3 \
+ golang \
+ git \
+ # Used to copy certs in "Shared SSL certificate generation" step
+ rsync; \
+ dnf clean all
EXPOSE 443
-ENV MOJO_MODE production
-
-RUN if [[ "${RHEL_VERSION%%.*}" -ge 8 ]]; then \
- # If you get "Unknown repo: 'powertools'", pull a newer centos:8 image
- enable_repo='--enablerepo=powertools' || exit 1; \
- fi && \
- dnf -y --allowerasing $enable_repo install \
- cpanminus \
- expat-devel \
- gcc-c++ \
- git \
- golang \
- iproute \
- jq \
- libcurl \
- libcurl-devel \
- libidn-devel \
- libpcap-devel \
- openssl-devel \
- perl-core \
- perl-Crypt-ScryptKDF\
- perl-DBD-Pg \
- perl-DBI \
- perl-DBIx-Connector \
- perl-Digest-SHA1 \
- perl-JSON \
- perl-libwww-perl \
- perl-Net-Pcap \
- perl-TermReadKey \
- perl-Test-CPAN-Meta \
- perl-WWW-Curl \
- postgresql96-devel \
- tar && \
- dnf -y clean all && \
- mkdir -p /opt/traffic_ops/app/public && \
- cpanm Carton
ADD traffic_router/core/src/test/resources/geo/GeoLite2-City.mmdb.gz
/opt/traffic_ops/app/public/
WORKDIR /opt/traffic_ops/app
-ADD traffic_ops/app/cpanfile traffic_ops/install/bin/install_goose.sh ./
+ADD traffic_ops/install/bin/install_goose.sh ./
+RUN ./install_goose.sh && rm ./install_goose.sh && dnf -y remove git && dnf
clean all
-# Start with the existing traffic_ops/app/local directory
-COPY
infrastructure/cdn-in-a-box/traffic_ops/perl-cache/centos-${RHEL_VERSION:-8}/local
local
-RUN export POSTGRES_HOME=/usr/pgsql-9.6 PERL5LIB=$(pwd)/local/lib/perl5 && \
- echo 'Running carton...' && \
- [[ -d "${PERL5LIB}/x86_64-linux-thread-multi" ]]; existing_install=$? && \
- if ! carton && [[ $existing_install -eq 0 ]]; then \
- rm -rf local && \
- echo 'Removed modules, retrying carton...' && \
- carton || exit 1; \
- fi && \
- rm -rf $HOME/.cpan* /tmp/Dockerfile /tmp/local.tar.gz ./cpanfile
-RUN ./install_goose.sh
+ADD infrastructure/cdn-in-a-box/traffic_ops_data /traffic_ops_data
-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 rpm -Uvh /$(basename $TRAFFIC_OPS_RPM) && \
- rm /$(basename $TRAFFIC_OPS_RPM) && \
- 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
-# build (should never happen - Perl is supposed to be going away)
-RUN POSTGRES_HOME=/usr/pgsql-9.6 PERL5LIB=$(pwd)/local/lib/perl5 carton && \
- rm -rf $HOME/.cpan* /tmp/Dockerfile /tmp/local.tar.gz
-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 \
- /
+COPY $TRAFFIC_OPS_RPM /traffic_ops.rpm
+RUN rpm --install --nodeps --verbose --hash /traffic_ops.rpm && \
Review comment:
`--nodeps` was in here for the `trafficops-go` image but not for
`trafficops-perl` because the `trafficops-perl` service handled all of the
database setup. Now that TO Perl is gone, we should remove `--nodeps` to assert
that all of the necessary dependencies have been installed.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]