Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Commit

Permalink
Merge pull request #4036 from robaerd/docker-images
Browse files Browse the repository at this point in the history
Docker images and packaging for CentOS and openSUSE
  • Loading branch information
mpranj authored Sep 28, 2021
2 parents 28bbf3e + 9e9f22c commit e46ff03
Show file tree
Hide file tree
Showing 12 changed files with 465 additions and 15 deletions.
40 changes: 34 additions & 6 deletions doc/INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ For the following Linux distributions and package managers 0.9 packages are avai

- [Arch Linux](https://aur.archlinux.org/packages/elektra/)
- [Openwrt](https://github.com/openwrt/packages/tree/master/libs/elektra)
- [OpenSuse](https://software.opensuse.org/package/elektra)
- [LinuxBrew](https://github.com/Linuxbrew/homebrew-core/blob/master/Formula/elektra.rb)

### Debian/Ubuntu

We provide repositories for latest releases and latest builds from master (suite postfixed with `-unstable`) for following Debian-based distributions:

- Debian Bullseye
- Debian Buster
- Ubuntu Focal
- Ubuntu Bionic
Expand Down Expand Up @@ -58,34 +58,54 @@ To use our stable repositories with our latest releases, following steps need to
### Fedora

We provide repositories for latest releases and latest builds from master (suite postfixed with `-unstable`) for Fedora 33.
We provide repositories for latest releases and latest builds from master (suite postfixed with `-unstable`) for Fedora 33 and Fedora 34

For our stable repository with our latest releases:

```sh
wget https://rpms.libelektra.org/fedora-33/libelektra.repo -O libelektra.repo;
wget https://rpms.libelektra.org/fedora-34/libelektra.repo -O libelektra.repo;
sudo mv libelektra.repo /etc/yum.repos.d/;
sudo yum update
```

Or alternatively you can use dnf to add this repo:

```sh
sudo dnf config-manager --add-repo https://rpms.libelektra.org/fedora-33/libelektra.repo
sudo dnf config-manager --add-repo https://rpms.libelektra.org/fedora-34/libelektra.repo
```

For our latest builds from master append `-unstable` to the suite name:

```sh
wget https://rpms.libelektra.org/fedora-33-unstable/libelektra.repo -O libelektra.repo;
wget https://rpms.libelektra.org/fedora-34-unstable/libelektra.repo -O libelektra.repo;
sudo mv libelektra.repo /etc/yum.repos.d/;
sudo yum update
```

Or alternatively you can use dnf to add this repo:

```sh
sudo dnf config-manager --add-repo https://rpms.libelektra.org/fedora-33-unstable/libelektra.repo
sudo dnf config-manager --add-repo https://rpms.libelektra.org/fedora-34-unstable/libelektra.repo
```

### openSUSE

We provide repositories for latest releases and latest builds from master (suite postfixed with `-unstable`) for openSUSE Leap 15.3

For our stable repository with our latest releases:

> NOTE: stable packages will be available as of the `0.9.8` release.
```sh
sudo zypper ar -f https://rpms.libelektra.org/opensuse-leap-15.3 libelektra
sudo zypper update
```

For our latest builds from master append `-unstable` to the suite name:

```sh
sudo zypper ar -f https://rpms.libelektra.org/opensuse-leap-15.3-unstable libelektra-unstable
sudo zypper update
```

### Install
Expand All @@ -97,6 +117,8 @@ To get all packaged plugins, bindings and tools install:
apt-get install libelektra5-all
# For Fedora based distributions
dnf install libelektra5-all
# For openSUSE
zypper install libelektra5-all
```

For a small installation with command-line tools available use:
Expand All @@ -106,6 +128,8 @@ For a small installation with command-line tools available use:
apt-get install elektra-bin
# For Fedora based distributions
dnf install elektra-bin
# For openSUSE
zypper install elektra-bin
```

To install all debugsym/debuginfo packages:
Expand All @@ -115,6 +139,8 @@ To install all debugsym/debuginfo packages:
apt-get install elektra-dbg
# For Fedora based distributions
dnf install elektra-dbg
# For openSUSE
zypper install elektra-dbg
```

If you want to install individual debugsym/debuginfo packages:
Expand All @@ -124,6 +150,8 @@ If you want to install individual debugsym/debuginfo packages:
apt-get install <packagename>-dbgsym # e.g. apt-get install libelektra5-dbgsym
# For Fedora based distributions
dnf debuginfo-install <packagename> # e.g. dnf debuginfo-install libelektra5
# For openSUSE
zypper install <packagename>-debuginfo # e.g. zypper install libelektra5-debuginfo
```

To build Debian/Ubuntu Packages from the source you might want to use:
Expand Down
4 changes: 3 additions & 1 deletion doc/news/_preparation_next_release.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ _(Michael Tucek)_

## Packaging

- <<TODO>>
- Add packages for openSuse Leap 15.3. _(Robert Sowula)_
- <<TODO>>
- <<TODO>>

Expand All @@ -262,6 +262,7 @@ _(Michael Tucek)_
- Enable BuildKit features to leverage tmpfs to speed up `docker build` commands. _(Mihael Pranjić)_
- Bump Gradle to version 7.2. _(Mihael Pranjić)_
- Bump Debian Buster images to Bullseye and Stretch images to Buster. We still leave one Debian Stretch job due to upstream Debian LTS support until June 2022. _(Mihael Pranjić)_
- Add Dockerfiles for openSUSE Leap 15.3 and CentOS Stream 8. _(Robert Sowula)_
- <<TODO>>
- Add docker image for OpenWrt package building. _(Robert Sowula)_
- Add files generated by docker when tutorial [run-all-tests-with-docker](https://www.libelektra.org/tutorials/run-all-tests-with-docker) is followed to .gitignore. _(Tobias Schubert @qwepoizt)_
Expand All @@ -278,6 +279,7 @@ _(Michael Tucek)_
- <<TODO>>
- <<TODO>>
- Move check stages that don't build the code to a dedicated stage, to avoid confusion when parallel builds are aborted. _(Robert Sowula)_
- Add test stages for openSUSE and CentOS. _(Robert Sowula)_
- Use `tmpfs` in Docker to speed up the test suite. _(Mihael Pranjić)_
- Add OpenWrt package building stage to release pipeline. _(Robert Sowula)_

Expand Down
3 changes: 2 additions & 1 deletion scripts/cmake/ElektraPackaging.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ if (UNIX)
string (STRIP "${OS_PRETTY_NAME}" OS_PRETTY_NAME)
endif (NOT APPLE)
set (OS_DISTRIB "${OS_NAME}${OS_VERSION_ID}")
string (REPLACE " " "-" OS_DISTRIB "${OS_DISTRIB}") # replace spaces with dashes, since rpm-build can't handle paths with spaces
if (NOT OS_DISTRIB)
set (OS_DISTRIB "unix")
endif (NOT OS_DISTRIB)
Expand Down Expand Up @@ -357,7 +358,7 @@ if (UNIX)

include (PackagingDebian)

elseif ("${OS_NAME}" MATCHES "Fedora|CentOS")
elseif ("${OS_NAME}" MATCHES "Fedora|CentOS|openSUSE")
# no debuginfo for python3-elektra on fedora
list (APPEND COMPONENTS_WITHOUT_DBGSYM "python3-elektra")
set (FEDORA_DBG_PACKAGE_NAMES "")
Expand Down
16 changes: 13 additions & 3 deletions scripts/cmake/Modules/PackagingFedora.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ set (CPACK_RPM_LIBELEKTRA${SO_VERSION}-EXPERIMENTAL_PACKAGE_DESCRIPTION "${PACKA
set (CPACK_RPM_LIBELEKTRA${SO_VERSION}-EXPERIMENTAL_DEBUGINFO_PACKAGE "${PACKAGE_DEBUGINFO}")

set (CPACK_RPM_LIBELEKTRA${SO_VERSION}-EXTRA_PACKAGE_NAME "${CPACK_COMPONENT_LIBELEKTRA${SO_VERSION}-EXTRA_DISPLAY_NAME}")
if ("${OS_NAME}" MATCHES "openSUSE")
set (CPACK_RPM_LIBELEKTRA${SO_VERSION}-EXTRA_PACKAGE_REQUIRES "glibc-locale")
endif ()
set (CPACK_RPM_LIBELEKTRA${SO_VERSION}-EXTRA_PACKAGE_SUGGESTS "elektra-doc, ${ALL_PLUGINS_STR}")
set (CPACK_RPM_LIBELEKTRA${SO_VERSION}-EXTRA_PACKAGE_SUMMARY "${CPACK_COMPONENT_LIBELEKTRA${SO_VERSION}-EXTRA_DESCRIPTION}")
set (CPACK_RPM_LIBELEKTRA${SO_VERSION}-EXTRA_PACKAGE_DESCRIPTION "${PACKAGE_DESCRIPTION}")
Expand All @@ -82,6 +85,9 @@ set (CPACK_RPM_LIBELEKTRA-DEV_PACKAGE_SUMMARY "${CPACK_COMPONENT_LIBELEKTRA-DEV_
set (CPACK_RPM_LIBELEKTRA-DEV_PACKAGE_DESCRIPTION "${PACKAGE_DESCRIPTION}")

set (CPACK_RPM_LIBELEKTRA${SO_VERSION}-AUGEAS_PACKAGE_NAME "${CPACK_COMPONENT_LIBELEKTRA${SO_VERSION}-AUGEAS_DISPLAY_NAME}")
if ("${OS_NAME}" MATCHES "openSUSE")
set (CPACK_RPM_LIBELEKTRA${SO_VERSION}-AUGEAS_PACKAGE_REQUIRES "augeas-lenses")
endif ()
set (CPACK_RPM_LIBELEKTRA${SO_VERSION}-AUGEAS_PACKAGE_SUMMARY "${CPACK_COMPONENT_LIBELEKTRA${SO_VERSION}-AUGEAS_DESCRIPTION}")
set (CPACK_RPM_LIBELEKTRA${SO_VERSION}-AUGEAS_PACKAGE_DESCRIPTION "${PACKAGE_DESCRIPTION}")
set (CPACK_RPM_LIBELEKTRA${SO_VERSION}-AUGEAS_DEBUGINFO_PACKAGE "${PACKAGE_DEBUGINFO}")
Expand Down Expand Up @@ -142,7 +148,7 @@ set (CPACK_RPM_LIBELEKTRA${SO_VERSION}-LUA_PACKAGE_DESCRIPTION "${PACKAGE_DESCRI
set (CPACK_RPM_LIBELEKTRA${SO_VERSION}-LUA_DEBUGINFO_PACKAGE "${PACKAGE_DEBUGINFO}")

set (CPACK_RPM_LIBELEKTRA${SO_VERSION}-JAVA_PACKAGE_NAME "${CPACK_COMPONENT_LIBELEKTRA${SO_VERSION}-JAVA_DISPLAY_NAME}")
set (CPACK_RPM_LIBELEKTRA${SO_VERSION}-JAVA_PACKAGE_REQUIRES "java-1.8.0-openjdk-devel")
set (CPACK_RPM_LIBELEKTRA${SO_VERSION}-JAVA_PACKAGE_REQUIRES "java-11-openjdk-devel")
set (CPACK_RPM_LIBELEKTRA${SO_VERSION}-JAVA_PACKAGE_SUMMARY "${CPACK_COMPONENT_LIBELEKTRA${SO_VERSION}-JAVA_DESCRIPTION}")
set (CPACK_RPM_LIBELEKTRA${SO_VERSION}-JAVA_PACKAGE_DESCRIPTION "${PACKAGE_DESCRIPTION}")
set (CPACK_RPM_LIBELEKTRA${SO_VERSION}-JAVA_DEBUGINFO_PACKAGE "${PACKAGE_DEBUGINFO}")
Expand All @@ -154,7 +160,7 @@ set (CPACK_RPM_LIBELEKTRA${SO_VERSION}-FUSE_PACKAGE_DESCRIPTION "${PACKAGE_DESCR
set (CPACK_RPM_LIBELEKTRA${SO_VERSION}-FUSE_DEBUGINFO_PACKAGE "OFF")

set (CPACK_RPM_JAVA-ELEKTRA_PACKAGE_NAME "${CPACK_COMPONENT_JAVA-ELEKTRA_DISPLAY_NAME}")
set (CPACK_RPM_JAVA-ELEKTRA_PACKAGE_REQUIRES "java-1.8.0-openjdk-devel")
set (CPACK_RPM_JAVA-ELEKTRA_PACKAGE_REQUIRES "java-11-openjdk-devel")
set (CPACK_RPM_JAVA-ELEKTRA_PACKAGE_SUMMARY "${CPACK_COMPONENT_JAVA-ELEKTRA_DESCRIPTION}")
set (CPACK_RPM_JAVA-ELEKTRA_PACKAGE_DESCRIPTION "${PACKAGE_DESCRIPTION}")

Expand Down Expand Up @@ -213,7 +219,11 @@ set (CPACK_RPM_ELEKTRA-BIN-EXTRA_PACKAGE_DESCRIPTION "${PACKAGE_DESCRIPTION}")
set (CPACK_RPM_ELEKTRA-BIN-EXTRA_DEBUGINFO_PACKAGE "OFF")

set (CPACK_RPM_ELEKTRA-QT-GUI_PACKAGE_NAME "${CPACK_COMPONENT_ELEKTRA-QT-GUI_DISPLAY_NAME}")
set (CPACK_RPM_ELEKTRA-QT-GUI_PACKAGE_REQUIRES "qt5-qtquickcontrols")
if ("${OS_NAME}" MATCHES "openSUSE")
set (CPACK_RPM_ELEKTRA-QT-GUI_PACKAGE_REQUIRES "libqt5-qtquickcontrols")
else ()
set (CPACK_RPM_ELEKTRA-QT-GUI_PACKAGE_REQUIRES "qt5-qtquickcontrols")
endif ()
set (CPACK_RPM_ELEKTRA-QT-GUI_PACKAGE_SUMMARY "${CPACK_COMPONENT_ELEKTRA-QT-GUI_DESCRIPTION}")
set (CPACK_RPM_ELEKTRA-QT-GUI_PACKAGE_DESCRIPTION "${PACKAGE_DESCRIPTION}")
set (CPACK_RPM_ELEKTRA-QT-GUI_DEBUGINFO_PACKAGE "${PACKAGE_DEBUGINFO}")
Expand Down
119 changes: 119 additions & 0 deletions scripts/docker/centos/stream8/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
FROM quay.io/centos/centos:stream8

# Enable PowerTools repo
RUN dnf config-manager --set-enabled powertools
# Enable EPEL repo
RUN dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm

RUN dnf upgrade --refresh -y && dnf install -y \
augeas-devel \
bison \
bison-devel \
cmake \
curl \
dbus-devel \
diffutils \
dnf-plugins-core \
file \
findutils \
flex \
flex-devel \
gcc-c++ \
ghostscript \
git \
glib2 \
gpgme-devel \
graphviz \
java-11-openjdk-devel \
jna \
libasan \
libcurl-devel \
libdrm-devel \
libev-devel \
libgcrypt-devel \
libgit2-devel \
libmarkdown-devel \
libubsan \
libuv-devel \
libxml2-devel \
llvm \
lua-devel \
make \
ninja-build \
openssl-devel \
procps-ng \
python3-devel \
qt5-qtbase-devel \
qt5-qtdeclarative-devel \
qt5-qtsvg-devel \
rpmdevtools \
rpm-build \
ruby-devel \
rubygem-test-unit \
strace \
swig \
systemd-devel \
unzip \
valgrind \
wget \
which \
xerces-c-devel \
yajl-devel \
yaml-cpp-devel \
zeromq-devel \
zlib-devel \
python3-pip \
&& dnf debuginfo-install -y \
bison \
flex \
glib2 \
glibc \
gpgme \
libgcrypt \
ruby-libs \
&& dnf clean all -y

# Build dependency for libelektra-fuse
RUN pip3 install wheel

# Google Test
ENV GTEST_ROOT=/opt/gtest
ARG GTEST_VER=release-1.11.0
RUN mkdir -p ${GTEST_ROOT} \
&& cd /tmp \
&& curl -o gtest.tar.gz \
-L https://github.com/google/googletest/archive/${GTEST_VER}.tar.gz \
&& tar -zxvf gtest.tar.gz --strip-components=1 -C ${GTEST_ROOT} \
&& rm gtest.tar.gz

# Create User:Group
# The id is important as jenkins docker agents use the same id that is running
# on the slaves to execute containers
ARG JENKINS_GROUPID
RUN groupadd \
-g ${JENKINS_GROUPID} \
-f \
jenkins

ARG JENKINS_USERID
RUN useradd \
--create-home \
--uid ${JENKINS_USERID} \
--gid ${JENKINS_GROUPID} \
--shell "/bin/bash" \
jenkins

# download and install gradle
RUN cd /tmp && wget https://services.gradle.org/distributions/gradle-7.2-bin.zip && unzip gradle-7.2-bin.zip && rm gradle-7.2-bin.zip && mv gradle-7.2 /opt/gradle
ENV PATH "${PATH}:/opt/gradle/bin"
ENV JAVA_HOME=/etc/alternatives/jre
RUN alternatives --auto java && alternatives --auto javac

USER ${JENKINS_USERID}

# extend PATH for user jenkins to include gradle
RUN echo "export PATH=${PATH}:/opt/gradle/bin" >> /home/jenkins/.bashrc

# Set git config
RUN git config --global user.email 'Jenkins <[email protected]>' \
&& git config --global user.name 'Jenkins'
Loading

0 comments on commit e46ff03

Please sign in to comment.