From 53697d26c684c1ef99d750c8d71112729bafe4d1 Mon Sep 17 00:00:00 2001 From: PascalEgn Date: Wed, 31 Jul 2024 14:54:13 +0200 Subject: [PATCH] docker: use fedora base image --- Dockerfile | 99 ++++++++++++++++++++++-------------------------- Dockerfile.dev | 101 ++++++++++++++++++++++--------------------------- 2 files changed, 92 insertions(+), 108 deletions(-) diff --git a/Dockerfile b/Dockerfile index 30176da5b7..702b8cc057 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,40 +24,32 @@ # Modified and simplified version of https://github.com/inspirehep/inspire-docker # to build an imagine to run in https://github.com/inspirehep/inspirehep -FROM centos:7 -# https://www.redhat.com/en/blog/centos-linux-has-reached-its-end-life-eol -# https://serverfault.com/a/1161904 -COPY CentOS-Base.repo ./etc/yum.repos.d/CentOS-Base.repo -RUN yum clean all && yum makecache - -RUN yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm && \ - yum update -y --nogpgcheck && \ - yum install -y --nogpgcheck \ - ImageMagick \ - transfig \ - file \ - firefox \ - gcc \ - gcc-c++ \ - git \ - kstart \ - libffi-devel \ - libxml2-devel \ - libxslt-devel \ - mailcap \ - make \ - openssl-devel \ - poppler-utils \ - postgresql \ - postgresql-libs \ - postgresql-devel \ - python-pip \ - python-devel \ - python2-xrootd \ - wget \ - Xvfb \ - && \ - yum clean all +FROM fedora:41 + +RUN dnf update -y +RUN dnf install -y ImageMagick +RUN dnf install -y transfig +RUN dnf install -y file +RUN dnf install -y firefox +RUN dnf install -y gcc +RUN dnf install -y gcc-c++ +RUN dnf install -y git +RUN dnf install -y kstart +RUN dnf install -y libffi-devel +RUN dnf install -y libxml2-devel +RUN dnf install -y libxslt-devel +RUN dnf install -y mailcap +RUN dnf install -y install xrootd-client-devel +RUN dnf install -y openssl-devel +RUN dnf install -y poppler-utils +RUN dnf install -y postgresql +RUN dnf install -y postgresql-libs +RUN dnf install -y postgresql-devel +RUN dnf install -y python2.7 +RUN dnf install -y wget +RUN dnf install -y Xvfb +RUN dnf install -y xrootd +RUN dnf clean all ENV NODE_VERSION 6.17.1 RUN mkdir /usr/local/nvm @@ -80,32 +72,33 @@ RUN npm install -g \ requirejs \ uglify-js -ENV PATH="/root/.poetry/bin:${PATH}" \ - POETRY_VIRTUALENVS_CREATE=false \ - POETRY_VERSION=1.1.14 - WORKDIR /code -RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/4ec09d4e6b8ca007e67bb873c96277b54986fbdb/get-poetry.py \ - | sed -E 's/(self\._get\(self\.METADATA_URL\).decode)\(\)/\1("utf-8")/' \ - | python && \ - poetry --version && \ - pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org --ignore-installed --no-cache-dir --upgrade pip==20.3.4 && \ - pip install --no-cache-dir --upgrade setuptools && \ - pip install --no-cache-dir --upgrade wheel && \ - pip install --no-cache-dir typing==3.7.4.1 +RUN wget https://bootstrap.pypa.io/pip/2.7/get-pip.py && \ + python2 get-pip.py && \ + rm get-pip.py + +RUN python2.7 -m pip install poetry==1.1.15 +RUN python2.7 -m pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org --ignore-installed --upgrade pip==20.3.4 +RUN python2.7 -m pip install --upgrade setuptools +RUN python2.7 -m pip install --upgrade wheel +RUN python2.7 -m pip install typing==3.7.4.1 COPY . . -RUN poetry export --without-hashes -E all -E xrootd -f requirements.txt > requirements.poetry.txt && \ - pip install --ignore-installed --requirement requirements.poetry.txt && \ - pip install -e . +RUN poetry config virtualenvs.create false +RUN poetry export --without-hashes -E all -E xrootd -f requirements.txt > requirements.poetry.txt +RUN python2.7 -m pip install --ignore-installed --requirement requirements.poetry.txt +RUN python2.7 -m pip install -e . +RUN python2.7 -m pip install git+https://github.com/PascalEgn/xrootd-python.git +RUN python2.7 -m pip install pathlib2==2.3.5 six==1.14.0 urllib3==1.24.3 + WORKDIR /usr/var/inspirehep-instance/static -RUN inspirehep npm && \ - npm install && \ - inspirehep collect -v && \ - inspirehep assets build +RUN inspirehep npm +RUN npm install +RUN inspirehep collect -v +RUN inspirehep assets build WORKDIR /code diff --git a/Dockerfile.dev b/Dockerfile.dev index a40887db2f..4b7ddbb7e0 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -24,42 +24,32 @@ # Modified and simplified version of https://github.com/inspirehep/inspire-docker # to build an imagine to run in https://github.com/inspirehep/inspirehep -FROM centos:7 -# https://www.redhat.com/en/blog/centos-linux-has-reached-its-end-life-eol -# https://serverfault.com/a/1161904 -COPY CentOS-Base.repo ./etc/yum.repos.d/CentOS-Base.repo -RUN yum clean all && yum makecache - -RUN yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm && \ - yum update -y --nogpgcheck && \ - yum install -y --nogpgcheck \ - yum update -y && \ - yum install -y \ - ImageMagick \ - transfig \ - file \ - firefox \ - gcc \ - gcc-c++ \ - git \ - kstart \ - libffi-devel \ - libxml2-devel \ - libxslt-devel \ - mailcap \ - make \ - openssl-devel \ - poppler-utils \ - postgresql \ - postgresql-libs \ - postgresql-devel \ - python-pip \ - python-devel \ - python2-xrootd \ - wget \ - Xvfb \ - && \ - yum clean all +FROM fedora:41 + +RUN dnf update -y +RUN dnf install -y ImageMagick +RUN dnf install -y transfig +RUN dnf install -y file +RUN dnf install -y firefox +RUN dnf install -y gcc +RUN dnf install -y gcc-c++ +RUN dnf install -y git +RUN dnf install -y kstart +RUN dnf install -y libffi-devel +RUN dnf install -y libxml2-devel +RUN dnf install -y libxslt-devel +RUN dnf install -y mailcap +RUN dnf install -y install xrootd-client-devel +RUN dnf install -y openssl-devel +RUN dnf install -y poppler-utils +RUN dnf install -y postgresql +RUN dnf install -y postgresql-libs +RUN dnf install -y postgresql-devel +RUN dnf install -y python2.7 +RUN dnf install -y wget +RUN dnf install -y Xvfb +RUN dnf install -y xrootd +RUN dnf clean all ENV NODE_VERSION 6.17.1 RUN mkdir /usr/local/nvm @@ -82,32 +72,33 @@ RUN npm install -g \ requirejs \ uglify-js -ENV PATH="/root/.poetry/bin:${PATH}" \ - POETRY_VIRTUALENVS_CREATE=false \ - POETRY_VERSION=1.1.14 - WORKDIR /code -RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/4ec09d4e6b8ca007e67bb873c96277b54986fbdb/get-poetry.py \ - | sed -E 's/(self\._get\(self\.METADATA_URL\).decode)\(\)/\1("utf-8")/' \ - | python && \ - poetry --version && \ - pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org --ignore-installed --no-cache-dir --upgrade pip==20.3.4 && \ - pip install --no-cache-dir --upgrade setuptools && \ - pip install --no-cache-dir --upgrade wheel && \ - pip install --no-cache-dir typing==3.7.4.1 +RUN wget https://bootstrap.pypa.io/pip/2.7/get-pip.py && \ + python2 get-pip.py && \ + rm get-pip.py + +RUN python2.7 -m pip install poetry==1.1.15 +RUN python2.7 -m pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org --ignore-installed --upgrade pip==20.3.4 +RUN python2.7 -m pip install --upgrade setuptools +RUN python2.7 -m pip install --upgrade wheel +RUN python2.7 -m pip install typing==3.7.4.1 COPY . . -RUN poetry export --without-hashes -E all -f requirements.txt > requirements.poetry.txt && \ - pip install --ignore-installed --src /opt/python-git-modules/ --requirement requirements.poetry.txt && \ - pip install -e . +RUN poetry config virtualenvs.create false +RUN poetry export --without-hashes -E all -f requirements.txt > requirements.poetry.txt +RUN python2.7 -m pip install --ignore-installed --src /opt/python-git-modules/ --requirement requirements.poetry.txt +RUN python2.7 -m pip install -e . +RUN python2.7 -m pip install git+https://github.com/PascalEgn/xrootd-python.git +RUN python2.7 -m pip install pathlib2==2.3.5 six==1.14.0 urllib3==1.24.3 + WORKDIR /usr/var/inspirehep-instance/static -RUN inspirehep npm && \ - npm install && \ - inspirehep collect -v && \ - inspirehep assets build +RUN inspirehep npm +RUN npm install +RUN inspirehep collect -v +RUN inspirehep assets build WORKDIR /code