1- FROM oraclelinux:8
1+ FROM oraclelinux:8.6
2+ ARG TARGETPLATFORM
23
34LABEL maintainer="philipp.salvisberg@trivadis.com"
45LABEL description="Tools to generate HTML and PDF using Materials for MkDocs and wkhtmltopdf."
5- LABEL build.command="docker build . --tag trivadis/mktools:latest"
6+
7+ # To build a mulit-architecture image and push it to the docker registry (load is not supported)
8+ LABEL build.prepare.command="docker buildx create --use --name mktools"
9+ LABEL build.multiarch.command="docker buildx build --platform linux/amd64,linux/arm64 . --tag trivadis/mktools:latest --push"
10+
11+ # To build a single-architecture image and load it into local docker images list (not possible for multi-architecture images)
12+ LABEL build.amd64.command="docker buildx build --platform linux/amd64 . --tag trivadis/mktools:latest --load"
13+ LABEL build.arm64.command="docker buildx build --platform linux/ard64 . --tag trivadis/mktools:latest --load"
614
715# install python
816RUN dnf -y update
9- RUN dnf -y install python38 python38 -pip
17+ RUN dnf -y install python39 python39 -pip
1018
1119# install git
1220RUN dnf -y install git
@@ -15,14 +23,23 @@ RUN dnf -y install git
1523# using "--root" should suppress "WARNING: Running pip install with root privileges is generally not a good idea." in future releases
1624RUN python3 -m pip install --upgrade pip --root /
1725RUN python3 -m pip install --root / \
18- 'mkdocs==1.1.2' \
19- 'mkdocs-material==6.2.8' \
20- 'mkdocs-awesome-pages-plugin==2.5.0' \
21- 'pymdown-extensions==8.1.1' \
22- 'mike==0.5.5'
23-
24- # install wkhtmltox 0.12.6
25- RUN dnf -y install https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox-0.12.6-1.centos8.x86_64.rpm
26+ 'mkdocs==1.3.1' \
27+ 'mkdocs-material==8.3.9' \
28+ 'mkdocs-awesome-pages-plugin==2.8.0' \
29+ 'pymdown-extensions==9.5' \
30+ 'mike==1.1.2' \
31+ 'setuptools==63.4.2'
32+
33+ # install wkhtmltox 0.12.6.1 r2
34+ RUN if [ "$TARGETPLATFORM" == "linux/amd64" ] ; \
35+ then dnf -y install https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-2/wkhtmltox-0.12.6.1-2.almalinux8.x86_64.rpm ; \
36+ else dnf -y install https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-2/wkhtmltox-0.12.6.1-2.almalinux8.aarch64.rpm ; \
37+ fi
38+
39+ # install Node.js, PostCSS Preset Env and csstools-cli (used to simplify CSS so that it is understood by wkhtmltopdf)
40+ RUN dnf -y module install nodejs:16
41+ RUN npm install postcss-preset-env -g
42+ RUN npm install @csstools/csstools-cli -g
2643
2744# set environment
2845ENV LANG=en_US.utf8
0 commit comments