Skip to content

Commit

Permalink
Fix git installation path on CentOS 7 docker image (#33132)
Browse files Browse the repository at this point in the history
When checking GHA logs of OS Compatibility build, I notice info log
```
The repository will be downloaded using the GitHub REST API
To create a local Git repository instead, add Git 2.18 or higher to the PATH
```
suggesting that our self-compiled git is not being used. For some reason out git binary was installed in /usr/local/usr/local/bin/git. I removed the additional /usr/local prefix to install the binary in the correct directory. I also updated git to the latest version.
  • Loading branch information
jakule authored Oct 26, 2023
1 parent 891c1be commit a530389
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions build.assets/Dockerfile-centos7
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ RUN yum groupinstall -y 'Development Tools' && \
${DEVTOOLSET}-make && \
yum clean all

RUN wget https://github.com/git/git/archive/refs/tags/v2.39.1.tar.gz && \
tar xf v2.39.1.tar.gz && \
cd git-2.39.1/ && \
RUN wget https://github.com/git/git/archive/refs/tags/v2.42.0.tar.gz && \
tar xf v2.42.0.tar.gz && \
cd git-2.42.0/ && \
scl enable ${DEVTOOLSET} "make configure && \
./configure --prefix=/usr/local && \
make -j6 all && \
make -j"$(nproc)" all && \
DESTDIR=/opt/git make install"

# Create an alias to the assets image. Ref: https://github.com/docker/for-mac/issues/2155
Expand Down Expand Up @@ -199,8 +199,8 @@ RUN yum groupinstall -y 'Development Tools' && \
yum clean all && \
localedef -c -i en_US -f UTF-8 en_US.UTF-8

# Override the old git installed by yum. We need git 2+ on GitHub Actions.
COPY --from=git2 /opt/git /usr/local
# Override the old git in /usr/local installed by yum. We need git 2+ on GitHub Actions.
COPY --from=git2 /opt/git /

ARG BUILDARCH

Expand Down

0 comments on commit a530389

Please sign in to comment.