diff --git a/.github/workflows/container-build-and-publish-fedora-based.yml b/.github/workflows/container-build-and-publish-fedora-based.yml index b967dbc..d02de1f 100644 --- a/.github/workflows/container-build-and-publish-fedora-based.yml +++ b/.github/workflows/container-build-and-publish-fedora-based.yml @@ -54,7 +54,7 @@ jobs: # List of base OSes, based on RPM packages # For some reason, as of end 2024, the automatic build of Fedora # stalls. Locally, there is no issue - os_img: [fedora39, fedora40] + os_img: [fedora41, fedora40] # https://github.com/cpp-projects-showcase/docker-images/settings/environments/4430897264/edit environment: docker-hub diff --git a/README.md b/README.md index 94039d9..23d82a0 100644 --- a/README.md +++ b/README.md @@ -20,8 +20,8 @@ The supported Linux distributions are [CentOS Stream 10 compose artifacts](https://composes.stream.centos.org/stream-10/development/latest-CentOS-Stream/compose/BaseOS/x86_64/iso/)), [CentOS 9 Stream](https://blog.centos.org/2021/12/introducing-centos-stream-9/), [CentOS 8 Stream](https://wiki.centos.org/Manuals/ReleaseNotes/CentOS8.2004), +[Fedora 41](https://docs.fedoraproject.org/en-US/fedora/f41/release-notes/index.html), [Fedora 40](https://docs.fedoraproject.org/en-US/fedora/f40/release-notes/index.html), -[Fedora 39](https://docs.fedoraproject.org/en-US/fedora/f39/release-notes/index.html), [Ubuntu 24.04 LTS (Noble Numbat)](https://releases.ubuntu.com/24.04/), [Ubuntu 22.04 LTS (Jammy Jellyfish)](https://releases.ubuntu.com/22.04/), [Ubuntu 20.04 LTS (Focal Fossa)](https://releases.ubuntu.com/20.04/), @@ -54,7 +54,7 @@ available for every one to use. # Using the pre-built development images * Start the Docker container featuring the target Linux distribution (`` may be one of `rocky9`, `centos9`, `centos8`, - `fedora40`, `fedora39`, `debian12`, `debian11`, + `fedora41`, `fedora40`, `debian12`, `debian11`, `ubuntu2404`, `ubuntu2204`, or `ubuntu2004`): ```bash $ docker pull infrahelpers/cpppython: @@ -112,7 +112,7 @@ Resolving deltas: 100% (3665/3665), done. # Customize a Docker Image The images may be customized, and pushed to Docker Cloud; `` may be one of `rocky9`, `centos9`, `centos8`, -`fedora40`, `fedora39`, `debian12`, `debian11`, +`fedora41`, `fedora40`, `debian12`, `debian11`, `ubuntu2404`, `ubuntu2204`, or `ubuntu2004`: ```bash $ mkdir -p ~/dev diff --git a/os/fedora39/Dockerfile b/archives/fedora39/Dockerfile similarity index 100% rename from os/fedora39/Dockerfile rename to archives/fedora39/Dockerfile diff --git a/os/fedora39/resources/bashrc b/archives/fedora39/resources/bashrc similarity index 100% rename from os/fedora39/resources/bashrc rename to archives/fedora39/resources/bashrc diff --git a/os/fedora39/resources/gitconfig b/archives/fedora39/resources/gitconfig similarity index 100% rename from os/fedora39/resources/gitconfig rename to archives/fedora39/resources/gitconfig diff --git a/os/fedora39/resources/vimrc b/archives/fedora39/resources/vimrc similarity index 100% rename from os/fedora39/resources/vimrc rename to archives/fedora39/resources/vimrc diff --git a/os/fedora41/Dockerfile b/os/fedora41/Dockerfile new file mode 100644 index 0000000..bc4331f --- /dev/null +++ b/os/fedora41/Dockerfile @@ -0,0 +1,99 @@ +# +# Dockerfile: http://github.com/cpp-projects-showcase/docker-images/tree/main/fedora41 +# Usual Docker tag: infrahelpers/cpppython:fedora41 +# Docker Hub/Cloud page: https://cloud.docker.com/u/infrahelpers/repository/docker/infrahelpers/cpppython +# +FROM fedora:41 + +LABEL authors="Christophe Gattardi " +LABEL version="0.1" + +# Docker build time environment variables +ENV container="docker" +ENV HOME="/home/build" + +# Update of Fedora and configure the locale +RUN dnf -y upgrade && \ + dnf -y install glibc-locale-source glibc-langpack-en && \ + dnf -y clean all && \ + localedef -f UTF-8 -i en_US en_US.UTF-8 + +# +ENV LANGUAGE="en_US:en" +ENV LANG="en_US.UTF-8" +ENV LC_ALL="$LANG" + +# Environment for the `root` user +ADD resources/bashrc /root/.bashrc + +# Basic, C++ and Python packages +RUN dnf -y upgrade && \ + dnf -y install less htop net-tools bind-utils which sudo man vim \ + git-all wget curl file bash-completion keyutils \ + zlib-devel bzip2-devel gzip tar patch rpmconf yum-utils \ + langtable gcc gcc-c++ cmake cmake3 m4 cppunit-devel \ + zeromq-devel czmq-devel cppzmq-devel openblas-devel \ + boost-devel xapian-core-devel openssl-devel libffi-devel \ + mpich-devel openmpi-devel \ + readline-devel sqlite-devel mysql-devel \ + soci-mysql-devel soci-sqlite3-devel +RUN dnf -y install libicu-devel protobuf-devel protobuf-compiler \ + python3-mod_wsgi \ + python3 python3-devel \ + python3.8 python3.9 \ + python3.10 python3.10-devel python3.12 python3.12-devel \ + geos-devel \ + graphviz ghostscript doxygen \ + R-devel \ + rubygem-rake \ + jq +RUN dnf -y install "tex(latex)" texlive-epstopdf-bin +RUN dnf -y clean all + +# yq, the YAML CLI utility like jq, for YAML (https://github.com/mikefarah/yq) +RUN YQ_VER=$(curl -Ls https://api.github.com/repos/mikefarah/yq/releases/latest | grep 'tag_name' | cut -d'v' -f2,2 | cut -d'"' -f1,1) && \ + architecture=$(uname -m|sed 's/x86_/amd/') && \ + echo "YQ_VER=${YQ_VER} - architecture=${architecture}" && \ + curl -Ls \ + https://github.com/mikefarah/yq/releases/download/v${YQ_VER}/yq_linux_${architecture} -o /usr/local/bin/yq && \ + chmod +x /usr/local/bin/yq + +# Create the `build` user (for the development activities) +RUN adduser build +RUN echo "build ALL=(root) NOPASSWD:ALL" > /etc/sudoers.d/build && \ + chmod 0440 /etc/sudoers.d/build + +# Configure SSH +RUN mkdir -p $HOME/.ssh && chmod 700 $HOME/.ssh + +# Set up the packaging environment for the `build` user +ADD resources/bashrc $HOME/.bashrc +ADD resources/gitconfig $HOME/.gitconfig +ADD resources/vimrc $HOME/.vimrc +RUN chmod 640 $HOME/.bashrc $HOME/.gitconfig $HOME/.vimrc +RUN chown -R build.build $HOME + +# Switch to the `build` user +WORKDIR $HOME +USER build + +# Git prompt +RUN git clone https://github.com/magicmonty/bash-git-prompt.git $HOME/.bash-git-prompt --depth=1 + +# Python, Pyenv and pipenv (https://www.python.org/downloads/) +RUN git clone https://github.com/pyenv/pyenv.git $HOME/.pyenv + +# Hack to git update $HOME/.pyenv +WORKDIR $HOME/.pyenv +RUN git pull +WORKDIR $HOME + +ENV PATH="$HOME/.pyenv/bin:$HOME/.pyenv/shims:$PATH" +# Python 3.13.1 +RUN pyenv install 3.13.1 && \ + pyenv global 3.13.1 && \ + pip install -U pip +RUN pyenv global system || echo "No default system version of Python. Sticking to 3.13.1" + +# Entry point +CMD ["/bin/bash"] diff --git a/os/fedora41/resources/bashrc b/os/fedora41/resources/bashrc new file mode 100644 index 0000000..03eda5a --- /dev/null +++ b/os/fedora41/resources/bashrc @@ -0,0 +1,38 @@ + +# Locale +export LANG="en_US.UTF-8" +export LC_ALL="en_US.UTF-8" + +# History +export HISTTIMEFORMAT="%d/%m/%y %T " + +# Prompt +source /usr/share/git-core/contrib/completion/git-prompt.sh +export GIT_PS1_SHOWDIRTYSTATE=true +export GIT_PS1_SHOWUNTRACKEDFILES=true +export PS1='[\u@\h \W$(__git_ps1 " (%s)")]\$ ' + +## Python pyenv +export PYENV_ROOT="${HOME}/.pyenv" +export PATH="${PYENV_ROOT}/bin:${PATH}" + +if command -v pyenv 1>/dev/null 2>&1; then + eval "$(pyenv init -)" +fi + +# Source global definitions +if [ -f /etc/bashrc ]; then + . /etc/bashrc +fi + +# Aliases +alias rm='rm -i' +alias cp='cp -i' +alias mv='mv -i' +alias dir='ls -laFh --color' +alias grep='grep --color' + +# OpenTREP +alias cdtrep='cd ~/dev/opentrep' + + diff --git a/os/fedora41/resources/gitconfig b/os/fedora41/resources/gitconfig new file mode 100644 index 0000000..993645f --- /dev/null +++ b/os/fedora41/resources/gitconfig @@ -0,0 +1,19 @@ +[alias] + st = status + cl = clone + co = checkout + ci = commit + br = branch + fe = fetch + pl = pull + ps = push + +[push] + default = tracking + +[pull] + rebase = false + +[color] + ui = auto + diff --git a/os/fedora41/resources/vimrc b/os/fedora41/resources/vimrc new file mode 100644 index 0000000..5e26739 --- /dev/null +++ b/os/fedora41/resources/vimrc @@ -0,0 +1,35 @@ +" General +syntax on +set number +set ruler +set visualbell +set encoding=utf-8 +set ignorecase +set showmatch +"set background=dark + +" Plugin management +"set nocompatible " be iMproved, required +"filetype off " required + +" Tell vim to remember certain things when we exit +" '10 : marks will be remembered for up to 10 previously edited files +" "100 : will save up to 100 lines for each register +" :20 : up to 20 lines of command-line history will be remembered +" % : saves and restores the buffer list +" n... : where to save the viminfo files +set viminfo='10,\"100,:20,%,n~/.viminfo + +function! ResCur() + if line("'\"") <= line("$") + normal! g`" + return 1 + endif +endfunction + +augroup resCur + autocmd! + autocmd BufWinEnter * call ResCur() +augroup END + +