Open brandan-schmitz opened 1 month ago
After some digging (I really wanted an installer haha) I was able to determine that if you add the following lines to the rpm/Dockerfile before it runs the command to install expect, then it fixes the build.
RUN sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo
RUN sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/*.repo
RUN sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/*.repo
RUN sed -i 's|http://download.fedoraproject.org/pub/epel/6/|https://archives.fedoraproject.org/pub/archive/epel/6/|g' /etc/yum.repos.d/*.repo
RUN sed -i 's|http://download.fedoraproject.org/pub/epel/testing/6/|https://archives.fedoraproject.org/pub/archive/epel/testing/6/|g' /etc/yum.repos.d/*.repo
This will make a Dockerfile that looks like this:
FROM jswank/centos-rpm:7
MAINTAINER Jason Swank <jswank@sonatype.com>
RUN sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo
RUN sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/*.repo
RUN sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/*.repo
RUN sed -i 's|http://download.fedoraproject.org/pub/epel/6/|https://archives.fedoraproject.org/pub/archive/epel/6/|g' /etc/yum.repos.d/*.repo
RUN sed -i 's|http://download.fedoraproject.org/pub/epel/testing/6/|https://archives.fedoraproject.org/pub/archive/epel/testing/6/|g' /etc/yum.repos.d/*.repo
RUN yum -y install expect
# force sha256 signature of rpm, instead of old default of sha1 used by CentOS7
RUN echo '%_gpg_digest_algo sha256' >> /usr/lib/rpm/macros
COPY ./ /data
RUN chown -R nobody /data/*
VOLUME /data
USER nobody
WORKDIR /data
@brandan-schmitz Thanks for digging into this! I agree the best path forward would be to no longer use CentOS, but I like the idea of getting the build working again in the short term.
I'd like to move forward with your fix, but I have a question:
The last couple sed
lines that alter "epel" urls don't appear to apply in this case because the original urls do not have version "6" in them (they all have version "7"). This makes me think maybe those last two sed
lines are not needed? (or should exclude the version number?)
The last couple
sed
lines that alter "epel" urls don't appear to apply in this case because the original urls do not have version "6" in them (they all have version "7"). This makes me think maybe those last twosed
lines are not needed? (or should exclude the version number?)
@bhamail you are correct that those are not needed. I missed that I still included those in my above comment. I had tested using the jswank/centos-rpm:latest
image at one point and had to use those but forgot to remove them when I went back to the jswank/centos-rpm:7
image after realizing that one was actually more updated.
@bhamail you are correct that those are not needed. I missed that I still included those in my above comment. I had tested using the
jswank/centos-rpm:latest
image at one point and had to use those but forgot to remove them when I went back to thejswank/centos-rpm:7
image after realizing that one was actually more updated.
Excellent! Do you want to create a PR?
I can, however it would be a few days before I am back at my actual computer I can do that with as I left for a trip today! I have no problem is someone else does in my place to get it fixed sooner.
It seems that the last few builds have failed in the CircleCI pipelines when trying to build this. It seems the fact that CentOS is EOL and that the http://mirrorlist.centos.org that is used in the current CentOS docker image to install expect is no longer online has broken builds of this.