Skip to content

Commit

Permalink
Merge pull request #252 from kiwix/kiwix-build
Browse files Browse the repository at this point in the history
Import Kiwix-build container images
  • Loading branch information
rgaudin authored Oct 30, 2023
2 parents dfaa2f6 + 7943adb commit d88c98b
Show file tree
Hide file tree
Showing 6 changed files with 183 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/kiwix-build_ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Kiwix-build container images

on:
push:
paths:
- 'kiwix-build_ci/**'
workflow_dispatch:

env:
IMAGE_PREFIX: ghcr.io/kiwix/kiwix-build_ci_

jobs:
Container:
strategy:
fail-fast: false
matrix:
variant: [f35, focal, bionic, alpine]
runs-on: ubuntu-22.04

steps:
- name: Get current date
run: echo "DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV

- name: Retrieve the code
uses: actions/checkout@v3

- name: Setup container image name
id: env
run: |
echo "IMAGE_NAME=${{ env.IMAGE_PREFIX }}${{ matrix.variant }}" >> $GITHUB_ENV
- name: Build container image
run: |
docker build -t ${{ env.IMAGE_NAME }}:dev - < kiwix-build_ci/${{ matrix.variant }}_builder.dockerfile
- name: Upload container image to :dev
run: |
echo "${{ secrets.GHCR_TOKEN }}" | docker login ghcr.io -u "${{ secrets.GHCR_USERNAME }}" --password-stdin
docker push ${{ env.IMAGE_NAME }}:dev
- name: Update production tags
if: github.event.ref == 'refs/heads/main'
run: |
docker tag ${{ env.IMAGE_NAME }}:dev ${{ env.IMAGE_NAME }}:${{ env.DATE }}
docker push ${{ env.IMAGE_NAME }}:${{ env.DATE }}
docker tag ${{ env.IMAGE_NAME }}:dev ${{ env.IMAGE_NAME }}:latest
docker push ${{ env.IMAGE_NAME }}:latest
15 changes: 15 additions & 0 deletions kiwix-build_ci/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
To run the `kiwix-build` command line tool for openZIM & Kiwix CI and
CD, Kiwix Build requires prepared compilation environments for
multiple GNU/Linux systems.

These prepared environments include: compilers, binary toolchains and
any third-party tool necessary to run the compilation toolchain. They
don't contain pre-compiled library dependencies build by kiwix-build,
(like Xapian, Libicu, Libmicrohttps, ...) but it contains dependencies
installed with package manager.

These container images are necessary and intended to be used by Kiwix
itself in many of its CI. But they are free to download et can be
reused, although they can break anytime, therefore at your won risk.
You can find them on
[here](https://github.com/orgs/kiwix/packages?tab=packages&q=kiwix-build).
24 changes: 24 additions & 0 deletions kiwix-build_ci/alpine_builder.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM alpine:3.16
LABEL org.opencontainers.image.source https://github.com/kiwix/container-images

ENV LANG C.UTF-8
ENV OS_NAME alpine

RUN apk update -q \
&& apk add -q --no-cache \
# Base build tools
bash build-base git py3-pip \
# Packaged dependencies
xz-dev \
zstd-dev \
xapian-core-dev \
icu-dev icu-data-full \
gtest-dev

# Create user
RUN addgroup --gid 121 runner
RUN adduser -u 1001 -G runner -h /home/runner -D runner
USER runner
ENV PATH /home/runner/.local/bin:$PATH
RUN pip3 install meson ninja ; \
ln -s /usr/bin/python3 /home/runner/.local/bin/python
27 changes: 27 additions & 0 deletions kiwix-build_ci/bionic_builder.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM ubuntu:bionic
LABEL org.opencontainers.image.source https://github.com/kiwix/container-images

ENV LANG C.UTF-8
ENV OS_NAME bionic

RUN apt update -q \
&& apt-get update \
&& apt install -q -y --no-install-recommends \
# Base build tools
build-essential automake libtool cmake ccache pkg-config autopoint patch \
python3-pip python3-setuptools python3-wheel git subversion wget unzip \
ninja-build openssh-client curl \
# Packaged dependencies
libbz2-dev uuid-dev zlib1g-dev \
libgtest-dev \
# Other tools (to remove)
# vim less grep \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/* /usr/share/doc/* /var/cache/debconf/* \
&& pip3 install meson pytest gcovr requests distro

# Create user
RUN groupadd --gid 121 runner
RUN useradd --uid 1001 --gid 121 --create-home runner
USER runner
ENV PATH /home/runner/.local/bin:$PATH
29 changes: 29 additions & 0 deletions kiwix-build_ci/f35_builder.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
FROM fedora:35
LABEL org.opencontainers.image.source https://github.com/kiwix/container-images

ENV LANG C.UTF-8
ENV OS_NAME f35

RUN dnf install -y --nodocs \
# Base build tools
make automake libtool cmake git-core subversion pkg-config gcc-c++ \
wget unzip ninja-build ccache which patch gcovr xz openssh-clients \
python3-pip \
# Cross win32 compiler
mingw32-gcc-c++ mingw32-bzip2-static mingw32-win-iconv-static \
mingw32-winpthreads-static mingw32-zlib-static mingw32-xz-libs-static \
mingw32-libmicrohttpd \
# python3
python3-pip python-unversioned-command \
# Other tools (to remove)
# vim less grep
&& dnf remove -y "*-doc" \
&& dnf autoremove -y \
&& dnf clean all \
&& pip3 install meson pytest requests distro

# Create user
RUN groupadd --gid 121 runner
RUN useradd --uid 1001 --gid 121 --create-home runner
USER runner
ENV PATH /home/runner/.local/bin:$PATH
41 changes: 41 additions & 0 deletions kiwix-build_ci/focal_builder.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
FROM ubuntu:focal
LABEL org.opencontainers.image.source https://github.com/kiwix/container-images

ENV LANG C.UTF-8
ENV OS_NAME focal
ENV DEBIAN_FRONTEND noninteractive

RUN apt update -q \
&& apt install -q -y --no-install-recommends \
# Base build tools
build-essential automake libtool cmake ccache pkg-config autopoint patch \
python3-pip python3-setuptools python3-wheel git subversion wget unzip \
ninja-build openssh-client curl libgl-dev \
# Python (2) is needed to install android-ndk
python \
# Packaged dependencies
libbz2-dev libmagic-dev uuid-dev zlib1g-dev \
libmicrohttpd-dev aria2 libgtest-dev libgl-dev \
# Devel package to compile python modules
libxml2-dev libxslt-dev python3-dev \
# Qt packages
libqt5gui5 qtbase5-dev qtwebengine5-dev libqt5svg5-dev qt5-image-formats-plugins qt5-default \
# To create the appimage of kiwix-desktop
libfuse2 fuse patchelf \
# Flatpak tools
elfutils flatpak flatpak-builder \
# Cross win32 compiler
g++-mingw-w64-i686 gcc-mingw-w64-i686 gcc-mingw-w64-base mingw-w64-tools \
# Cross compile i586
libc6-dev-i386 lib32stdc++6 gcc-multilib g++-multilib \
# Other tools (to remove)
# vim less grep \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/* /usr/share/doc/* /var/cache/debconf/* \
&& pip3 install meson pytest gcovr requests distro

# Create user
RUN groupadd --gid 121 runner
RUN useradd --uid 1001 --gid 121 --create-home runner
USER runner
ENV PATH /home/runner/.local/bin:$PATH

0 comments on commit d88c98b

Please sign in to comment.