Files
podman/docs/Containerfile
Mario Loriedo f6be9fbc7f Build documentation in a container on Win arm64
Locally building the windows installer requires to
build the documentation. And building documentation
requires Pandoc.

There is no pre-built binaries for Windows arm64
and this makes it complicated to build the Podman
Windows installer on Windows arm64.

To unlock this scenario we are adding a new winmake.ps1
target to build the documentation in a container (where
Pandoc is pre-installed).

Signed-off-by: Mario Loriedo <mario.loriedo@gmail.com>
2025-04-29 15:36:37 +02:00

22 lines
1.1 KiB
Docker

# The resulting image can be used to generate podman-remote documentation.
#
# The CMD expects that the podman git repository is bind mounted to /podman.
# The generated documentation will be copied to ./docs/build/remote/.
#
# Example usage:
# podman build --build-arg TARGET_OS=windows -t podman-docs-generator $(pwd)/docs
# podman run --rm -v $(pwd):/podman podman-docs-generator
#
FROM docker.io/golang:latest
ARG TARGET_OS=windows # valid values: macos, linux, windows
RUN apt-get update && apt-get install -y pandoc man
RUN mkdir -p /podman-copy/podman
ENV TARGET_OS=$TARGET_OS
WORKDIR /podman-copy/podman
CMD echo "Copying /podman/ to /podman-copy/. It will take some time but 1) the build will be faster 2) the local bin folder won't be overridden." && \
cp -a /podman/ /podman-copy/ && \
echo "Generating docs" && make podman-remote-${TARGET_OS}-docs && \
echo "Copying generated docs to /podman/" && mkdir -p /podman/docs/build/ && \
mkdir -p /podman/docs/build/remote/ && \
cp -a /podman-copy/podman/docs/build/remote/${TARGET_OS}/* /podman/docs/build/remote/