zrhoffman commented on a change in pull request #5209:
URL: https://github.com/apache/trafficcontrol/pull/5209#discussion_r578041921



##########
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:
       With `--nodeps` removed, there are unmet dependencies for both CentOS 7 
and CentOS 8.
   
   Dependencies that CentOS 7 complains about but CentOS 8 does not:
   ```shell
   golang >= 1.12 is needed by traffic_ops-5.1.0-11232.dc08115a.
   openssl-devel is needed by traffic_ops-5.1.0-11232.dc08115a.el7.x86_64
   ```
   
   Dependencies that CentOS 8 complains about but CentOS 7 does not:
   ```shell
   perl is needed by traffic_ops-5.1.0-11232.dc08115a.
   ```
   ---
   The full lists:
   
   With `RHEL_VERSION=7` in the environment and a CentOS 7 Traffic Ops RPM:
   ```shell
    => ERROR [11/12] RUN rpm --install --verbose --hash /traffic_ops.rpm &&  rm 
/traffic_ops.rpm                     1.0s
   ------
    > [11/12] RUN rpm --install --verbose --hash /traffic_ops.rpm &&       rm 
/traffic_ops.rpm:
   error: Failed dependencies:
   cpanminus is needed by traffic_ops-5.1.0-11232.dc08115a.el7.x86_64
   expat-devel is needed by traffic_ops-5.1.0-11232.dc08115a.el7.x86_64
   gcc-c++ is needed by traffic_ops-5.1.0-11232.dc08115a.el7.x86_64
   golang >= 1.12 is needed by traffic_ops-5.1.0-11232.dc08115a.el7.x86_64
   libcurl-devel is needed by traffic_ops-5.1.0-11232.dc08115a.el7.x86_64
   libidn-devel is needed by traffic_ops-5.1.0-11232.dc08115a.el7.x86_64
   libpcap-devel is needed by traffic_ops-5.1.0-11232.dc08115a.el7.x86_64
   openssl-devel is needed by traffic_ops-5.1.0-11232.dc08115a.el7.x86_64
   perl-DBD-Pg is needed by traffic_ops-5.1.0-11232.dc08115a.el7.x86_64
   perl-DBI is needed by traffic_ops-5.1.0-11232.dc08115a.el7.x86_64
   perl-Digest-SHA1 is needed by traffic_ops-5.1.0-11232.dc08115a.el7.x86_64
   perl-JSON is needed by traffic_ops-5.1.0-11232.dc08115a.el7.x86_64
   perl-TermReadKey is needed by traffic_ops-5.1.0-11232.dc08115a.el7.x86_64
   perl-Test-CPAN-Meta is needed by traffic_ops-5.1.0-11232.dc08115a.el7.x86_64
   perl-WWW-Curl is needed by traffic_ops-5.1.0-11232.dc08115a.el7.x86_64
   perl-core is needed by traffic_ops-5.1.0-11232.dc08115a.el7.x86_64
   perl-libwww-perl is needed by traffic_ops-5.1.0-11232.dc08115a.el7.x86_64
   postgresql96-devel >= 9.6.2 is needed by 
traffic_ops-5.1.0-11232.dc08115a.el7.x86_64
   ```
   
   With `RHEL_VERSION=8` in the environment and a CentOS 8 Traffic Ops RPM:
   ```
    > [11/12] RUN rpm --install --verbose --hash /traffic_ops.rpm &&       rm 
/traffic_ops.rpm:
   error: Failed dependencies:
   cpanminus is needed by traffic_ops-5.1.0-11232.dc08115a.el8.x86_64
   expat-devel is needed by traffic_ops-5.1.0-11232.dc08115a.el8.x86_64
   gcc-c++ is needed by traffic_ops-5.1.0-11232.dc08115a.el8.x86_64
   libcurl-devel is needed by traffic_ops-5.1.0-11232.dc08115a.el8.x86_64
   libidn-devel is needed by traffic_ops-5.1.0-11232.dc08115a.el8.x86_64
   libpcap-devel is needed by traffic_ops-5.1.0-11232.dc08115a.el8.x86_64
   perl is needed by traffic_ops-5.1.0-11232.dc08115a.el8.x86_64
   perl-DBD-Pg is needed by traffic_ops-5.1.0-11232.dc08115a.el8.x86_64
   perl-DBI is needed by traffic_ops-5.1.0-11232.dc08115a.el8.x86_64
   perl-Digest-SHA1 is needed by traffic_ops-5.1.0-11232.dc08115a.el8.x86_64
   perl-JSON is needed by traffic_ops-5.1.0-11232.dc08115a.el8.x86_64
   perl-TermReadKey is needed by traffic_ops-5.1.0-11232.dc08115a.el8.x86_64
   perl-Test-CPAN-Meta is needed by traffic_ops-5.1.0-11232.dc08115a.el8.x86_64
   perl-WWW-Curl is needed by traffic_ops-5.1.0-11232.dc08115a.el8.x86_64
   perl-core is needed by traffic_ops-5.1.0-11232.dc08115a.el8.x86_64
   perl-libwww-perl is needed by traffic_ops-5.1.0-11232.dc08115a.el8.x86_64
   postgresql96-devel >= 9.6.2 is needed by 
traffic_ops-5.1.0-11232.dc08115a.el8.x86_64
   ```




----------------------------------------------------------------
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]


Reply via email to