| ARG ARG_FROM=fedora:40 # default value to avoid warning |
| FROM $ARG_FROM |
| |
| # RUN . ./yocto-docs-venv/bin/activate doesn't work because env variables set |
| # in RUN don't persist, so set up the virtualenv manually ahead of time. |
| # Unsetting env variables in Containerfile is difficult, so we hope it works |
| # fine without doing that for PYTHONHOME (see activate script content). |
| # Note that the actual location depends on WORKDIR at this layer in the |
| # container, and it must match the pwd when pip3_docs.sh is run in a later |
| # layer. This *must* be outside of any mount point otherwise it won't be |
| # available within the container. |
| ENV VIRTUAL_ENV=/yocto-docs-venv |
| ENV PATH="$VIRTUAL_ENV/bin:$PATH" |
| |
| # Set the WORKDIR to / so the pip3_docs.sh script will find our virtual env |
| # when calling '. ./yocto-docs-venv/bin/activate'. |
| WORKDIR / |
| |
| ARG INCLUDE_ESSENTIAL_PACKAGES=0 |
| ARG ESSENTIAL=fedora_essential.sh |
| ARG DOCS=fedora_docs.sh |
| ARG DOCS_PDF=fedora_docs_pdf.sh |
| ARG PIP3=pip3_docs.sh |
| |
| ENV TEXTOOLDIR=/opt/docs-build-tex-tools |
| ENV PATH="$PATH:$TEXTOOLDIR/tl/bin/x86_64-linux" |
| |
| # relative to the location of the dockerfile |
| COPY --chmod=777 ${ESSENTIAL} /temp/host_packages_essential.sh |
| 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 \ |
| && if [ "$INCLUDE_ESSENTIAL_PACKAGES" = "1" ]; then yes | /temp/host_packages_essential.sh; fi \ |
| && 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"] |