From 0dafcf51505b42118e74d917f718ae551bede7df Mon Sep 17 00:00:00 2001 From: Ivan Dyachkov Date: Tue, 6 Dec 2022 09:13:40 +0100 Subject: [PATCH 1/3] chore: bump git version on el7 to 2.38.1 --- el7/Dockerfile | 15 ++++++++++++--- get-git.sh | 23 ----------------------- 2 files changed, 12 insertions(+), 26 deletions(-) delete mode 100755 get-git.sh diff --git a/el7/Dockerfile b/el7/Dockerfile index 2f99165..4ab9c06 100644 --- a/el7/Dockerfile +++ b/el7/Dockerfile @@ -40,11 +40,20 @@ RUN yum install -y devtoolset-8-gcc devtoolset-8-gcc-c++ ADD install-openssl11.sh /install-openssl11.sh RUN /install-openssl11.sh -COPY get-git.sh /get-git.sh -RUN /get-git.sh - WORKDIR / +ENV GIT_VERSION=2.38.1 DEVELOPER_CFLAGS='-std=gnu99' +RUN curl -L -o /tmp/git.tar.gz "https://github.com/git/git/archive/v${GIT_VERSION}.tar.gz" \ + && tar zxf /tmp/git.tar.gz -C /tmp \ + && cd "/tmp/git-${GIT_VERSION}/" \ + && make configure \ + && ./configure --prefix=/usr \ + && make all \ + && make install \ + && cd / \ + && rm -rf /tmp/git.tar.gz "/tmp/git-${GIT_VERSION}/" \ + && git --version + RUN curl -L -o /tmp/automake-1.14.tar.gz http://ftp.gnu.org/gnu/automake/automake-1.14.tar.gz \ && tar -zxvf /tmp/automake-1.14.tar.gz -C /tmp \ && cd /tmp/automake-1.14 \ diff --git a/get-git.sh b/get-git.sh deleted file mode 100755 index d85f118..0000000 --- a/get-git.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh - -set -eu - -GIT_VERSION="${GIT_VERSION:-2.31.1}" - -URL="https://github.com/git/git/archive/refs/tags/v${GIT_VERSION}.tar.gz" - -## download and untar -cd / -curl --silent --show-error -fkL "$URL" -o "git.tar.gz" -tar -zxf git.tar.gz - -## build -cd "/git-${GIT_VERSION}/" -make configure -./configure --prefix=/usr -make all -make install - -## cleanup -cd / -rm -rf git.tar.gz "/git-${GIT_VERSION}/" From 80256527b95994c43e9622792dd30518724897b2 Mon Sep 17 00:00:00 2001 From: Ivan Dyachkov Date: Tue, 6 Dec 2022 11:33:01 +0100 Subject: [PATCH 2/3] chore: sync handling of python3 in el7, el8 and al2 --- al2/Dockerfile | 18 +++++++++++------- el7/Dockerfile | 21 ++++++++++++--------- el8/Dockerfile | 15 +++++++-------- 3 files changed, 30 insertions(+), 24 deletions(-) diff --git a/al2/Dockerfile b/al2/Dockerfile index 3dd01b5..29dad3d 100644 --- a/al2/Dockerfile +++ b/al2/Dockerfile @@ -37,19 +37,23 @@ RUN yum install -y \ RUN yum groupinstall -y "Development Tools" -# cleanup -RUN yum clean packages && \ - rm -rf /tmp/* && \ - rm -rf /var/tmp/* - WORKDIR / COPY get-cmake.sh /get-cmake.sh RUN /get-cmake.sh build -# make python3 the default as the last step to not break yum RUN alternatives --install /usr/bin/python python /usr/bin/python2 1 && \ - alternatives --install /usr/bin/python python /usr/bin/python3 2 + alternatives --install /usr/bin/python python /usr/bin/python3 2 && \ + alternatives --set python /usr/bin/python3 && \ + alternatives --install /usr/bin/pip pip /usr/bin/pip2 1 && \ + alternatives --install /usr/bin/pip pip /usr/bin/pip3 2 && \ + alternatives --set pip /usr/bin/pip3 && \ + sed 's/python/python2/g' -i /usr/bin/yum + +# cleanup +RUN yum clean packages && \ + rm -rf /tmp/* && \ + rm -rf /var/tmp/* # Elixir complains if runs without UTF-8 ENV LC_ALL=C.UTF-8 diff --git a/el7/Dockerfile b/el7/Dockerfile index 4ab9c06..0b2a54d 100644 --- a/el7/Dockerfile +++ b/el7/Dockerfile @@ -10,6 +10,8 @@ RUN yum install -y autoconf \ libatomic \ libtool \ ncurses-devel \ + python3 \ + python3-pip \ systemd \ unixODBC-devel \ unzip \ @@ -73,17 +75,18 @@ RUN env OPENSSL_ROOT_DIR=/usr/local/openssl /get-cmake.sh build RUN sed -i -e '/override_install_langs/d' /etc/yum.conf && \ yum -q -y reinstall glibc-common -RUN yum install -y python3 -## we do not want python2 anymore -RUN ln -sf /usr/bin/python3 /usr/bin/python -RUN ln -sf /usr/bin/pip3 /usr/bin/pip - -## yum needs python2 -RUN sed 's/python/python2/g' -i /usr/bin/yum +RUN alternatives --install /usr/bin/python python /usr/bin/python2 1 && \ + alternatives --install /usr/bin/python python /usr/bin/python3 2 && \ + alternatives --set python /usr/bin/python3 && \ + alternatives --install /usr/bin/pip pip /usr/bin/pip2 1 && \ + alternatives --install /usr/bin/pip pip /usr/bin/pip3 2 && \ + alternatives --set pip /usr/bin/pip3 && \ + sed 's/python/python2/g' -i /usr/bin/yum # cleanup -RUN yum clean packages \ - && rm -rf /tmp/* /var/tmp/* +RUN yum clean packages && \ + rm -rf /tmp/* && \ + rm -rf /var/tmp/* ENV BASH_ENV=/opt/rh/devtoolset-8/enable \ ENV=/opt/rh/devtoolset-8/enable \ diff --git a/el8/Dockerfile b/el8/Dockerfile index 71e4d34..0146218 100644 --- a/el8/Dockerfile +++ b/el8/Dockerfile @@ -40,24 +40,23 @@ RUN yum install -y \ RUN yum groupinstall -y "Development Tools" -RUN yum install -y python3 - -## we do not want python2 anymore -RUN ln -sf /usr/bin/python3 /usr/bin/python -RUN ln -sf /usr/bin/pip3 /usr/bin/pip - WORKDIR / COPY get-cmake.sh /get-cmake.sh RUN /get-cmake.sh build +RUN alternatives --set python /usr/bin/python3 && \ + alternatives --install /usr/bin/pip pip /usr/bin/pip3 2 && \ + alternatives --set pip /usr/bin/pip3 + # cleanup RUN yum clean packages \ && rm -rf /tmp/* /var/tmp/* # Elixir complains if runs without UTF-8 -ENV LC_ALL=C.UTF-8 -ENV LANG=C.UTF-8 +RUN yum clean packages && \ + rm -rf /tmp/* && \ + rm -rf /var/tmp/* WORKDIR / CMD [ "/bin/bash" ] From 3755fc719b5bc2c4e075d893de60d025ab973788 Mon Sep 17 00:00:00 2001 From: Ivan Dyachkov Date: Tue, 6 Dec 2022 11:55:54 +0100 Subject: [PATCH 3/3] chore: rename al2 to amzn2 to follow amazon linux convention --- .github/workflows/base.yaml | 2 +- .github/workflows/main.yaml | 4 ++-- {al2 => amzn2}/Dockerfile | 0 el8/Dockerfile | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) rename {al2 => amzn2}/Dockerfile (100%) diff --git a/.github/workflows/base.yaml b/.github/workflows/base.yaml index 1dc1064..2365217 100644 --- a/.github/workflows/base.yaml +++ b/.github/workflows/base.yaml @@ -31,7 +31,7 @@ jobs: - [debian9 , "linux/amd64,linux/arm64"] - [el8 , "linux/amd64,linux/arm64"] - [el7 , "linux/amd64,linux/arm64"] - - [al2 , "linux/amd64,linux/arm64"] + - [amzn2 , "linux/amd64,linux/arm64"] - [raspbian10 , "linux/arm64"] - [raspbian9 , "linux/arm64"] - [alpine3.15.1, "linux/amd64,linux/arm64"] diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 7e99cd2..15e7d42 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -39,7 +39,7 @@ jobs: - [debian9 , "linux/amd64,linux/arm64"] - [el8 , "linux/amd64,linux/arm64"] - [el7 , "linux/amd64,linux/arm64"] - - [al2 , "linux/amd64,linux/arm64"] + - [amzn2 , "linux/amd64,linux/arm64"] - [raspbian10 , "linux/arm64"] - [raspbian9 , "linux/arm64"] - [alpine3.15.1, "linux/amd64,linux/arm64"] @@ -104,7 +104,7 @@ jobs: - [debian9 , "linux/amd64,linux/arm64"] - [el8 , "linux/amd64,linux/arm64"] - [el7 , "linux/amd64,linux/arm64"] - - [al2 , "linux/amd64,linux/arm64"] + - [amzn2 , "linux/amd64,linux/arm64"] - [raspbian10 , "linux/arm64"] - [raspbian9 , "linux/arm64"] - [alpine3.15.1, "linux/amd64,linux/arm64"] diff --git a/al2/Dockerfile b/amzn2/Dockerfile similarity index 100% rename from al2/Dockerfile rename to amzn2/Dockerfile diff --git a/el8/Dockerfile b/el8/Dockerfile index 0146218..c41cc74 100644 --- a/el8/Dockerfile +++ b/el8/Dockerfile @@ -50,13 +50,13 @@ RUN alternatives --set python /usr/bin/python3 && \ alternatives --set pip /usr/bin/pip3 # cleanup -RUN yum clean packages \ - && rm -rf /tmp/* /var/tmp/* - -# Elixir complains if runs without UTF-8 RUN yum clean packages && \ rm -rf /tmp/* && \ rm -rf /var/tmp/* +# Elixir complains if runs without UTF-8 +ENV LC_ALL=C.UTF-8 +ENV LANG=C.UTF-8 + WORKDIR / CMD [ "/bin/bash" ]