Skip to contentSkip to conversation

add script for containers building the documentation

PATCH Applied Quentin Schulz 2 participants 5 messages Jan 27, 2025 – Feb 22, 2025

lore
Share & tools
lore
#0 lore raw

v3 cover add script for containers building the documentation

Based on initial work done by Antonin Godard[1].

This does two things:
- move all the installation steps to fulfil the system requirements for each distro into separate files,
- add a script for using those separate files for building a container which allows to build the documentation within,

Note that not all distros we say we support in the System Requirements section work currently.

openSUSE Leap 15.6 somehow doesn't build but with not much interesting context.

Almalinux instructions are missing a bunch of packages and I reached a point where I couldn't find a package providing everysel.sty though texlive-ms seems to be providing it according to pkgs.org.

How far I went:

"""
diff --git a/documentation/tools/almalinux_host_packages_docs_pdf.sh b/documentation/tools/almalinux_host_packages_docs_pdf.sh
index 8341eb8c2..19f45312b 100644
--- a/documentation/tools/almalinux_host_packages_docs_pdf.sh
+++ b/documentation/tools/almalinux_host_packages_docs_pdf.sh
@@ -1 +1,5 @@
-sudo dnf install latexmk texlive-collection-fontsrecommended texlive-collection-latex texlive-collection-latexrecommended texlive-collection-xetex texlive-fncychap texlive-gnu-freefont texlive-tex-gyre texlive-xetex
+sudo dnf install -y epel-release
+sudo yum install dnf-plugins-core
+sudo dnf config-manager --set-enabled crb
+sudo dnf makecache
+sudo dnf install -y latexmk texlive-capt-of texlive-collection-fontsrecommended texlive-collection-latex texlive-collection-latexrecommended texlive-collection-xetex texlive-ctex texlive-fncychap texlive-framed texlive-gnu-freefont texlive-ms texlive-needspace texlive-tabulary texlive-tex-gyre texlive-upquote texlive-wrapfig texlive-xetex
"""

Note the dnf install -y for the packages is required for installing the GPG key of one of the repos noninteractively.

Older Debian and Ubuntu both lack python3-saneyaml and similar Python packages in their packagefeed.

Ubuntu 23.04 package feed isn't accessible anymore.

Note that this script cannot be run in parallel right now as all containers would be sharing the same build directory. This could be mitigated by allowing BUILDDIR to be overridden from the environment before being used by make and have it overridden by the script to a different location. There are probably other corner cases not handled (likely concurrent set_versions.py for example?).

This was only build tested, I haven't looked at the build output.

[1] https://lore.kernel.org/yocto-docs/[email protected]/
[2] https://lore.kernel.org/yocto-docs/[email protected]/

---
Changes in v3:
- add usage when the script is called with less than one argument or
with a first argument that isn't supported by the script for now,
- use sed to add --non-interactive to zypper commands instead of adding
them in the user instructions that would make it to the doc website,
- limit OCI images that can be used by hardcoding the tag (or start of
the tag),
- remove ability to "build" on non-working distros (they are commented
out with an explanation so someone can look at it if they feel like
it),
- added vim modeline so people using vim will use the same indentation
by default,
- rebase on master,
- Link to v2: https://lore.kernel.org/r/20241217-instructions-shell-container-v2-0-ce687b0cfac2@cherry.de

Changes in v2:
- rebase on master,
- fix issues for recent Ubuntu by setting the timezone,
- add support for building pdf docs from within container,
- fix support for passing multiple make targets to the script
- have all pip3-packages-requiring-distros use one file to make it easier to maintain,
- put scripts into a dedicated repo,
- rename variables and filenames to remove host_packages/packages from them to make things a bit more digest,
- fix incorrect comment in script about reading poky.yaml.in,

- Link to v1: https://lore.kernel.org/r/20241210-instructions-shell-container-v1-0-6a7cdc404ff4@cherry.de

---
Quentin Schulz (2):
docs: use literalinclude for system requirements
tools: add script for building documentation inside containers

 documentation/poky.yaml.in                         | 234 ---------------------
 documentation/ref-manual/system-requirements.rst   |  82 +++++---
 documentation/tools/Containerfile.almalinux        |   1 +
 documentation/tools/Containerfile.apt              |  26 +++
 documentation/tools/Containerfile.debian           |   1 +
 documentation/tools/Containerfile.dnf              |  25 +++
 documentation/tools/Containerfile.fedora           |   1 +
 documentation/tools/Containerfile.ubuntu           |   1 +
 documentation/tools/Containerfile.zypper           |  32 +++
 documentation/tools/build-docs-container           | 175 +++++++++++++++
 .../tools/host_packages_scripts/almalinux_docs.sh  |   1 +
 .../host_packages_scripts/almalinux_docs_pdf.sh    |   1 +
 .../host_packages_scripts/almalinux_essential.sh   |   5 +
 .../tools/host_packages_scripts/fedora_docs.sh     |   1 +
 .../tools/host_packages_scripts/fedora_docs_pdf.sh |   1 +
 .../host_packages_scripts/fedora_essential.sh      |   1 +
 .../tools/host_packages_scripts/opensuse_docs.sh   |   1 +
 .../host_packages_scripts/opensuse_docs_pdf.sh     |   1 +
 .../host_packages_scripts/opensuse_essential.sh    |   2 +
 .../tools/host_packages_scripts/pip3_docs.sh       |   1 +
 .../tools/host_packages_scripts/ubuntu_docs.sh     |   1 +
 .../tools/host_packages_scripts/ubuntu_docs_pdf.sh |   1 +
 .../host_packages_scripts/ubuntu_essential.sh      |   1 +
 23 files changed, 327 insertions(+), 269 deletions(-)

---
base-commit: 8bd2bc3c00ca80f4c000a2a8d618a9f8ea3aa54b
change-id: 20241210-instructions-shell-container-c5a84c043a35

Best regards,

Signature · 1 line
Quentin Schulz <[email protected]>
#1 lore raw

PATCH v3 1/2 docs: use literalinclude for system requirements

From: Quentin Schulz <[email protected]>

The YAML variables for the host dependencies are updated by hand and actually only used inside code blocks.

Let's migrate all instructions into separate shell scripts that are then literalinclude'd into the Sphinx documentation.

This allows a few things:
- ability to run shellcheck on the scripts if we ever want to
- manually calling the appropriate script from a supported distro to build stuff (distro or bitbake/yocto stuff)
- use this script to create containers to do CI of documentation on different distros, to make sure our instructions are all up to date,

---
 documentation/poky.yaml.in                         | 234 ---------------------
 documentation/ref-manual/system-requirements.rst   |  82 +++++---
 .../tools/host_packages_scripts/almalinux_docs.sh  |   1 +
 .../host_packages_scripts/almalinux_docs_pdf.sh    |   1 +
 .../host_packages_scripts/almalinux_essential.sh   |   5 +
 .../tools/host_packages_scripts/fedora_docs.sh     |   1 +
 .../tools/host_packages_scripts/fedora_docs_pdf.sh |   1 +
 .../host_packages_scripts/fedora_essential.sh      |   1 +
 .../tools/host_packages_scripts/opensuse_docs.sh   |   1 +
 .../host_packages_scripts/opensuse_docs_pdf.sh     |   1 +
 .../host_packages_scripts/opensuse_essential.sh    |   2 +
 .../tools/host_packages_scripts/pip3_docs.sh       |   1 +
 .../tools/host_packages_scripts/ubuntu_docs.sh     |   1 +
 .../tools/host_packages_scripts/ubuntu_docs_pdf.sh |   1 +
 .../host_packages_scripts/ubuntu_essential.sh      |   1 +
 15 files changed, 65 insertions(+), 269 deletions(-)
documentation/poky.yaml.in +0 -234
index d045ff596e6d7d7d46be373078e8bb8b38483267..c93b7806642b89fe78343513f0196c8b9318fc68 100644
@@ -24,237 +24,3 @@ MIN_DISK_SPACE : "90"
 MIN_DISK_SPACE_RM_WORK : "40"
 # RAM (Gbytes) needed to generate qemux86-64 core-image-sato on Ubuntu 22.04 (x86-64) on a 4 core system
 MIN_RAM : "8"
-
-#
-# Dependencies
-#
-
-# Shared between distros
-PIP3_HOST_PACKAGES_DOC: sphinx sphinx_rtd_theme pyyaml
-
-UBUNTU_DEBIAN_HOST_PACKAGES_ESSENTIAL: >-
-  build-essential
-  chrpath
-  cpio
-  debianutils
-  diffstat
-  file
-  gawk
-  gcc
-  git
-  iputils-ping
-  libacl1
-  liblz4-tool
-  locales
-  python3
-  python3-git
-  python3-jinja2
-  python3-pexpect
-  python3-pip
-  python3-subunit
-  socat
-  texinfo
-  unzip
-  wget
-  xz-utils
-  zstd
-
-UBUNTU_DEBIAN_HOST_PACKAGES_DOC: >-
-  git
-  librsvg2-bin
-  locales
-  make
-  python3-saneyaml
-  python3-sphinx-rtd-theme
-  sphinx
-
-UBUNTU_DEBIAN_HOST_PACKAGES_DOC_PDF: >-
-  fonts-freefont-otf
-  latexmk
-  tex-gyre
-  texlive-fonts-extra
-  texlive-fonts-recommended
-  texlive-lang-all
-  texlive-latex-extra
-  texlive-latex-recommended
-  texlive-xetex
-
-FEDORA_HOST_PACKAGES_ESSENTIAL: >-
-  bzip2
-  ccache
-  chrpath
-  cpio
-  cpp
-  diffstat
-  diffutils
-  file
-  findutils
-  gawk
-  gcc
-  gcc-c++
-  git
-  glibc-devel
-  glibc-langpack-en
-  gzip
-  hostname
-  libacl
-  lz4
-  make
-  patch
-  perl
-  perl-Data-Dumper
-  perl-File-Compare
-  perl-File-Copy
-  perl-FindBin
-  perl-Text-ParseWords
-  perl-Thread-Queue
-  perl-bignum
-  perl-locale
-  python
-  python3
-  python3-GitPython
-  python3-jinja2
-  python3-pexpect
-  python3-pip
-  rpcgen
-  socat
-  tar
-  texinfo
-  unzip
-  wget
-  which
-  xz
-  zstd
-
-FEDORA_HOST_PACKAGES_DOC: >-
-  git
-  glibc-locale-source
-  librsvg2-tools
-  make
-  python3-pip
-  which
-
-FEDORA_HOST_PACKAGES_DOC_PDF: >-
-  'texlive-collection-lang*'
-  latexmk
-  texlive-collection-fontsextra
-  texlive-collection-fontsrecommended
-  texlive-collection-latex
-  texlive-collection-latexextra
-  texlive-collection-latexrecommended
-  texlive-collection-xetex
-  texlive-fncychap
-  texlive-gnu-freefont
-  texlive-tex-gyre
-  texlive-xetex
-
-OPENSUSE_HOST_PACKAGES_ESSENTIAL: >-
-  bzip2
-  chrpath
-  diffstat
-  gcc
-  gcc-c++
-  git
-  gzip
-  hostname
-  libacl1
-  lz4
-  make
-  makeinfo
-  patch
-  python
-  python-curses
-  python-xml
-  python3
-  python3-Jinja2
-  python3-curses
-  python3-pexpect
-  python3-pip
-  rpcgen
-  socat
-  tar
-  wget
-  which
-  xz
-  zstd
-
-OPENSUSE_PIP3_HOST_PACKAGES_ESSENTIAL: GitPython
-
-OPENSUSE_HOST_PACKAGES_DOC: >-
-  git
-  glibc-i18ndata
-  make
-  python3-pip
-  rsvg-convert
-  which
-
-OPENSUSE_HOST_PACKAGES_DOC_PDF: >-
-  'texlive-collection-lang*'
-  texlive-collection-fontsextra
-  texlive-collection-fontsrecommended
-  texlive-collection-latex
-  texlive-collection-latexextra
-  texlive-collection-latexrecommended
-  texlive-collection-xetex
-  texlive-fncychap
-  texlive-gnu-freefont
-  texlive-latexmk
-  texlive-tex-gyre
-  texlive-xetex
-
-ALMALINUX_HOST_PACKAGES_ESSENTIAL: >-
-  bzip2
-  ccache
-  chrpath
-  cpio
-  cpp
-  diffstat
-  diffutils
-  gawk
-  gcc
-  gcc-c++
-  git
-  glibc-devel
-  glibc-langpack-en
-  gzip
-  libacl
-  lz4
-  make
-  patch
-  perl
-  perl-Data-Dumper
-  perl-Text-ParseWords
-  perl-Thread-Queue
-  python3
-  python3-GitPython
-  python3-jinja2
-  python3-pexpect
-  python3-pip
-  rpcgen
-  socat
-  tar
-  texinfo
-  unzip
-  wget
-  which
-  xz
-  zstd
-
-ALMALINUX_HOST_PACKAGES_DOC: >-
-  git
-  glibc-locale-source
-  librsvg2-tools
-  make
-  python3-pip
-  which
-
-ALMALINUX_HOST_PACKAGES_DOC_PDF: >-
-  latexmk
-  texlive-collection-fontsrecommended
-  texlive-collection-latex
-  texlive-collection-latexrecommended
-  texlive-collection-xetex
-  texlive-fncychap
-  texlive-gnu-freefont
-  texlive-tex-gyre
-  texlive-xetex
documentation/ref-manual/system-requirements.rst +47 -35

141 lines not on this page · raw message

documentation/tools/host_packages_scripts/almalinux_docs.sh new file +1 -0
new file mode 100644
index 0000000000000000000000000000000000000000..8188d529a1e9b8034e5b14ed4e9e633e7ae0600b
@@ -0,0 +1 @@
+sudo dnf install git glibc-locale-source librsvg2-tools make python3-pip which
documentation/tools/host_packages_scripts/almalinux_docs_pdf.sh new file +1 -0
new file mode 100644
index 0000000000000000000000000000000000000000..8341eb8c252d50b8a5cd3ff09ff013b1d49249bf
@@ -0,0 +1 @@
+sudo dnf install latexmk texlive-collection-fontsrecommended texlive-collection-latex texlive-collection-latexrecommended texlive-collection-xetex texlive-fncychap texlive-gnu-freefont texlive-tex-gyre texlive-xetex
documentation/tools/host_packages_scripts/almalinux_essential.sh new file +5 -0
new file mode 100644
index 0000000000000000000000000000000000000000..16f25fa1f29c84d512df97988f527d1ea834bea7
@@ -0,0 +1,5 @@
+sudo dnf install -y epel-release
+sudo yum install dnf-plugins-core
+sudo dnf config-manager --set-enabled crb
+sudo dnf makecache
+sudo dnf install bzip2 ccache chrpath cpio cpp diffstat diffutils gawk gcc gcc-c++ git glibc-devel glibc-langpack-en gzip libacl lz4 make patch perl perl-Data-Dumper perl-Text-ParseWords perl-Thread-Queue python3 python3-GitPython python3-jinja2 python3-pexpect python3-pip rpcgen socat tar texinfo unzip wget which xz zstd
documentation/tools/host_packages_scripts/fedora_docs.sh new file +1 -0
new file mode 100644
index 0000000000000000000000000000000000000000..8188d529a1e9b8034e5b14ed4e9e633e7ae0600b
@@ -0,0 +1 @@
+sudo dnf install git glibc-locale-source librsvg2-tools make python3-pip which
documentation/tools/host_packages_scripts/fedora_docs_pdf.sh new file +1 -0
new file mode 100644
index 0000000000000000000000000000000000000000..816f1c36ec35e046782d341bb70dff1834bfd8a1
@@ -0,0 +1 @@
+sudo dnf install 'texlive-collection-lang*' latexmk texlive-collection-fontsextra texlive-collection-fontsrecommended texlive-collection-latex texlive-collection-latexextra texlive-collection-latexrecommended texlive-collection-xetex texlive-fncychap texlive-gnu-freefont texlive-tex-gyre texlive-xetex
documentation/tools/host_packages_scripts/fedora_essential.sh new file +1 -0
new file mode 100644
index 0000000000000000000000000000000000000000..4841853e1e224683b563c8d6112446f0633a081b
@@ -0,0 +1 @@
+sudo dnf install bzip2 ccache chrpath cpio cpp diffstat diffutils file findutils gawk gcc gcc-c++ git glibc-devel glibc-langpack-en gzip hostname libacl lz4 make patch perl perl-Data-Dumper perl-File-Compare perl-File-Copy perl-FindBin perl-Text-ParseWords perl-Thread-Queue perl-bignum perl-locale python python3 python3-GitPython python3-jinja2 python3-pexpect python3-pip rpcgen socat tar texinfo unzip wget which xz zstd
documentation/tools/host_packages_scripts/opensuse_docs.sh new file +1 -0
new file mode 100644
index 0000000000000000000000000000000000000000..7d36eb0f99668168dc4fed44d71181338bdc59a3
@@ -0,0 +1 @@
+sudo zypper install git glibc-i18ndata make python3-pip rsvg-convert which
documentation/tools/host_packages_scripts/opensuse_docs_pdf.sh new file +1 -0
new file mode 100644
index 0000000000000000000000000000000000000000..ee9f07886ce1c0eac8e1d1118cda8ddc496f0139
@@ -0,0 +1 @@
+sudo zypper install 'texlive-collection-lang*' texlive-collection-fontsextra texlive-collection-fontsrecommended texlive-collection-latex texlive-collection-latexextra texlive-collection-latexrecommended texlive-collection-xetex texlive-fncychap texlive-gnu-freefont texlive-latexmk texlive-tex-gyre texlive-xetex
documentation/tools/host_packages_scripts/opensuse_essential.sh new file +2 -0
new file mode 100644
index 0000000000000000000000000000000000000000..a784f4a5dc05f3734177f08ed97663a04d20a978
@@ -0,0 +1,2 @@
+sudo zypper install bzip2 chrpath diffstat gcc gcc-c++ git gzip hostname libacl1 lz4 make makeinfo patch python python-curses python-xml python3 python3-Jinja2 python3-curses python3-pexpect python3-pip rpcgen socat tar wget which xz zstd
+sudo pip3 install GitPython
documentation/tools/host_packages_scripts/pip3_docs.sh new file +1 -0
new file mode 100644
index 0000000000000000000000000000000000000000..fd6ad98053fb6aa1ff55669191dc99578c830455
@@ -0,0 +1 @@
+sudo pip3 install sphinx sphinx_rtd_theme pyyaml
documentation/tools/host_packages_scripts/ubuntu_docs.sh new file +1 -0
new file mode 100644
index 0000000000000000000000000000000000000000..d2a1832e279057519321a1fb7820efd60d886564
@@ -0,0 +1 @@
+sudo apt install git librsvg2-bin locales make python3-saneyaml python3-saneyaml python3-sphinx-rtd-theme sphinx
documentation/tools/host_packages_scripts/ubuntu_docs_pdf.sh new file +1 -0
new file mode 100644
index 0000000000000000000000000000000000000000..d6310bd21deae81df32d0cb843aab4a5622ac4fa
@@ -0,0 +1 @@
+sudo apt install fonts-freefont-otf latexmk tex-gyre texlive-fonts-extra texlive-fonts-recommended texlive-lang-all texlive-latex-extra texlive-latex-recommended texlive-xetex
documentation/tools/host_packages_scripts/ubuntu_essential.sh new file +1 -0
new file mode 100644
index 0000000000000000000000000000000000000000..f3388c88c93d885e3b035651e434c669654ee241
@@ -0,0 +1 @@
+sudo apt-get install build-essential chrpath cpio debianutils diffstat file gawk gcc git iputils-ping libacl1 liblz4-tool locales python3 python3-git python3-jinja2 python3-pexpect python3-pip python3-subunit socat texinfo unzip wget xz-utils zstd
Signature · 1 line
2.48.1
#2 lore raw

PATCH v3 2/2 tools: add script for building documentation inside containers

In reply to Quentin Schulz

From: Quentin Schulz <[email protected]>

This adds a script for building a container and building the documentation within that new container image.

The openSUSE instructions now require a --non-interactive flag otherwise they fail to run. Sadly there doesn't seem to be a way to have this in an environment variable à-la DEBIAN_FRONTEND=noninteractive, so we simply do a sed on the scripts to add --non-interactive to the zypper commands to avoid having those in the instructions provided to our users.

Somehow tzdata package in Ubuntu doesn't respect DEBIAN_FRONTEND=noninteractive hence why the timezone needs to be set by hand.

---
 documentation/tools/Containerfile.almalinux |   1 +
 documentation/tools/Containerfile.apt       |  26 +++++
 documentation/tools/Containerfile.debian    |   1 +
 documentation/tools/Containerfile.dnf       |  25 ++++
 documentation/tools/Containerfile.fedora    |   1 +
 documentation/tools/Containerfile.ubuntu    |   1 +
 documentation/tools/Containerfile.zypper    |  32 +++++
 documentation/tools/build-docs-container    | 175 ++++++++++++++++++++++++++++
 8 files changed, 262 insertions(+)
documentation/tools/Containerfile.almalinux new file +1 -0
new file mode 120000
index 0000000000000000000000000000000000000000..7237e9b99f4132957c0ad5b11fa6cefe9daaec74
@@ -0,0 +1 @@
+Containerfile.dnf
\ No newline at end of file
documentation/tools/Containerfile.apt new file +26 -0
new file mode 100644
index 0000000000000000000000000000000000000000..5e30b65eb8f81a7764c00eb1078dabaf59b64517
@@ -0,0 +1,26 @@
+ARG ARG_FROM=debian:12 # default value to avoid warning
+FROM $ARG_FROM
+
+ARG DOCS=ubuntu_docs.sh
+ARG DOCS_PDF=ubuntu_docs_pdf.sh
+
+ENV DEBIAN_FRONTEND=noninteractive
+ARG TZ=Europe/Vienna
+
+# relative to the location of the dockerfile
+COPY --chmod=777 ${DOCS} /temp/host_packages_docs.sh
+COPY --chmod=777 ${DOCS_PDF} /temp/host_packages_docs_pdf.sh
+
+RUN ln -fs "/usr/share/zoneinfo/$TZ" /etc/localtime \
+ && apt-get update \
+ && apt-get install -y sudo \
+ && yes | /temp/host_packages_docs.sh \
+ && yes | /temp/host_packages_docs_pdf.sh \
+ && apt-get --yes autoremove \
+ && apt-get clean \
+ && rm -rf /temp
+
+RUN git config --global --add safe.directory /docs
+
+ENTRYPOINT ["/usr/bin/env", "make", "-C", "documentation/"]
+CMD ["publish"]
documentation/tools/Containerfile.debian new file +1 -0
new file mode 120000
index 0000000000000000000000000000000000000000..5a7a425197afc2928802fcad5f34699b1ad3348a
@@ -0,0 +1 @@
+Containerfile.apt
\ No newline at end of file
documentation/tools/Containerfile.dnf new file +25 -0
new file mode 100644
index 0000000000000000000000000000000000000000..3dae74445585961a6f2d29b8acde09f2456dd886
@@ -0,0 +1,25 @@
+ARG ARG_FROM=fedora:40 # default value to avoid warning
+FROM $ARG_FROM
+
+ARG DOCS=fedora_docs.sh
+ARG DOCS_PDF=fedora_docs_pdf.sh
+ARG PIP3=pip3_docs.sh
+
+# relative to the location of the dockerfile
+COPY --chmod=777 ${DOCS} /temp/host_packages_docs.sh
+COPY --chmod=777 ${DOCS_PDF} /temp/host_packages_docs_pdf.sh
+COPY --chmod=777 ${PIP3} /temp/pip3_docs.sh
+
+RUN dnf update -y \
+ && dnf install -y sudo \
+ && yes | /temp/host_packages_docs.sh \
+ && yes | /temp/host_packages_docs_pdf.sh \
+ && yes | /temp/pip3_docs.sh \
+ && dnf autoremove -y \
+ && dnf clean all -y \
+ && rm -rf /temp
+
+RUN git config --global --add safe.directory /docs
+
+ENTRYPOINT ["/usr/bin/env", "make", "-C", "documentation/"]
+CMD ["publish"]
documentation/tools/Containerfile.fedora new file +1 -0
new file mode 120000
index 0000000000000000000000000000000000000000..7237e9b99f4132957c0ad5b11fa6cefe9daaec74
@@ -0,0 +1 @@
+Containerfile.dnf
\ No newline at end of file
documentation/tools/Containerfile.ubuntu new file +1 -0
new file mode 120000
index 0000000000000000000000000000000000000000..5a7a425197afc2928802fcad5f34699b1ad3348a
@@ -0,0 +1 @@
+Containerfile.apt
\ No newline at end of file
documentation/tools/Containerfile.zypper new file +32 -0
new file mode 100644
index 0000000000000000000000000000000000000000..f27ad1b476999f4f2cebb47b89025b1c9f89cec1
@@ -0,0 +1,32 @@
+ARG ARG_FROM=opensuse/leap:15.4 # default value to avoid warning
+FROM $ARG_FROM
+
+ARG DOCS=opensuse_docs.sh
+ARG DOCS_PDF=opensuse_docs_pdf.sh
+ARG PIP3=pip3_docs.sh
+
+# relative to the location of the dockerfile
+COPY --chmod=777 ${DOCS} /temp/host_packages_docs.sh
+COPY --chmod=777 ${DOCS_PDF} /temp/host_packages_docs_pdf.sh
+COPY --chmod=777 ${PIP3} /temp/pip3_docs.sh
+
+# Zypper doesn't have environment variables to specify whether to run in
+# non-interactive mode like Debian does with DEBIAN_FRONTEND and piping yes to
+# the scripts doesn't need to be enough as well, so let's force all zypper calls
+# to be non-interactive by adding the appropriate flag in the scripts.
+RUN for script in /temp/*.sh; do \
+	sed -i 's/zypper/zypper --non-interactive/' $script; \
+    done
+
+RUN zypper update -y \
+ && zypper install -y sudo \
+ && yes | /temp/host_packages_docs.sh \
+ && yes | /temp/host_packages_docs_pdf.sh \
+ && yes | /temp/pip3_docs.sh \
+ && zypper clean --all \
+ && rm -rf /temp
+
+RUN git config --global --add safe.directory /docs
+
+ENTRYPOINT ["/usr/bin/env", "make", "-C", "documentation/"]
+CMD ["publish"]
documentation/tools/build-docs-container new file +175 -0

175 lines not on this page · raw message

Signature · 1 line
2.48.1
Reviewed-by Tested-by on the v3 series
#3 lore raw
In reply to Quentin Schulz

Hi Quentin,

Quoted 8 lines · Quentin Schulz

Based on initial work done by Antonin Godard[1].

This does two things:
- move all the installation steps to fulfil the system requirements for each distro into separate files,
- add a script for using those separate files for building a container which allows to build the documentation within,

[...]

For the two patches:

Thanks again, I will use these quite a lot.

Antonin

Signature · 3 lines
Antonin Godard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#4 lore raw
In reply to Quentin Schulz
Quoted 9 lines · Quentin Schulz

Based on initial work done by Antonin Godard[1].

This does two things:
- move all the installation steps to fulfil the system requirements for each distro into separate files,
- add a script for using those separate files for building a container which allows to build the documentation within,

[...]

Applied, thanks!

[1/2] docs: use literalinclude for system requirements

      commit: 8d993022c2aefc0fde9baa949d39d7a3613f9f46
[2/2] tools: add script for building documentation inside containers
      commit: cefced592f1302fcb65afa9e0b1f9f5ff1570e93

Best regards,

Signature · 1 line
Antonin Godard <[email protected]>