Created
February 5, 2021 20:37
-
-
Save pwillis-els/21d5cc97b886212e56c8ff2eea62c3ba to your computer and use it in GitHub Desktop.
Test patching sudo in your old horrible CentOS 6 instance
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM centos:6 | |
# This works, but don't use yum update, it'll update too many packages | |
RUN CENTOSVER=`cat /etc/centos-release | grep 'CentOS release' | awk '{print $3}'` ; \ | |
grep -v mirrorlist /etc/yum.repos.d/CentOS-Base.repo \ | |
| sed -e 's/^#baseurl=/baseurl=/g' \ | |
| sed -e "s?baseurl=http://mirror.centos.org/centos/\$releasever/?baseurl=https://vault.centos.org/$CENTOSVER/?g" \ | |
> /etc/yum.repos.d/CentOS-Base.repo.new ; \ | |
mv -f /etc/yum.repos.d/CentOS-Base.repo.new /etc/yum.repos.d/CentOS-Base.repo | |
RUN curl -L -o sudo-patched.rpm https://github.com/sudo-project/sudo/releases/download/SUDO_1_9_5p2/sudo-1.9.5-3.el6.x86_64.rpm | |
RUN yum install -y sudo && rpm -qi sudo && sudo -V | |
RUN rpm -ev sudo && rpm -Uvh sudo-patched.rpm && rpm -qi sudo && sudo -V | |
RUN rpm -ev sudo && yum install -y sudo && rpm -qi sudo && sudo -V |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment