Skip to content

Commit

Permalink
Added Fedora 41 and archived Fedora 39
Browse files Browse the repository at this point in the history
  • Loading branch information
da115115 committed Dec 9, 2024
1 parent 2e206d8 commit a71acb9
Show file tree
Hide file tree
Showing 10 changed files with 195 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/),
Expand Down Expand Up @@ -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
(`<linux-distrib>` may be one of `rocky9`, `centos9`, `centos8`,
`fedora40`, `fedora39`, `debian12`, `debian11`,
`fedora41`, `fedora40`, `debian12`, `debian11`,
`ubuntu2404`, `ubuntu2204`, or `ubuntu2004`):
```bash
$ docker pull infrahelpers/cpppython:<linux-distrib>
Expand Down Expand Up @@ -112,7 +112,7 @@ Resolving deltas: 100% (3665/3665), done.
# Customize a Docker Image
The images may be customized, and pushed to Docker Cloud;
`<linux-distrib>` may be one of `rocky9`, `centos9`, `centos8`,
`fedora40`, `fedora39`, `debian12`, `debian11`,
`fedora41`, `fedora40`, `debian12`, `debian11`,
`ubuntu2404`, `ubuntu2204`, or `ubuntu2004`:
```bash
$ mkdir -p ~/dev
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
99 changes: 99 additions & 0 deletions os/fedora41/Dockerfile
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>"
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"]
38 changes: 38 additions & 0 deletions os/fedora41/resources/bashrc
Original file line number Diff line number Diff line change
@@ -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'


19 changes: 19 additions & 0 deletions os/fedora41/resources/gitconfig
Original file line number Diff line number Diff line change
@@ -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

35 changes: 35 additions & 0 deletions os/fedora41/resources/vimrc
Original file line number Diff line number Diff line change
@@ -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


0 comments on commit a71acb9

Please sign in to comment.