Skip to content

Commit fed483d

Browse files
authored
Fix git usability for CentOS 7 nightly images (#306)
1 parent 5d771d7 commit fed483d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

nightly-main/centos/7/Dockerfile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ FROM centos:7
22
LABEL maintainer="Swift Infrastructure <[email protected]>"
33
LABEL description="Docker Container for the Swift programming language"
44

5-
# centos 7 ships with git 1.x which is too old for the toolchain usage, using RH software collections to install git 2.x
5+
# CentOS 7 ships with git 1.x which is too old for the toolchain usage, using RH software collections to install git 2.x
66
RUN yum install -y centos-release-scl-rh
77

88
RUN yum install shadow-utils.x86_64 -y \
@@ -23,8 +23,10 @@ RUN yum install shadow-utils.x86_64 -y \
2323
sqlite \
2424
zlib-devel
2525

26-
# centos 7 ships with git 1.x which is too old for the toolchain usage
27-
RUN ln -s /opt/rh/rh-git227/root/bin/git /usr/bin/git
26+
# Enable git 2.x from RH software collections for both login and non-login shells
27+
RUN ln -s /opt/rh/rh-git227/enable /etc/profile.d/git.sh
28+
ENV ENV=/etc/profile.d/git.sh
29+
ENV BASH_ENV=$ENV
2830

2931
RUN sed -i -e 's/\*__block/\*__libc_block/g' /usr/include/unistd.h
3032

0 commit comments

Comments
 (0)