Run noninteractive builds with gcc-toolset-15

To perform noninteractive builds, run the gcc-toolset-15 image with a predefined build script that exits upon completion.

Before you begin

  • The gcc-toolset-15 image is available locally.
  • A host directory for source and build scripts, for example, /srv/src.
  • A host directory for build output, for example, /srv/build-output.
  • A build script, for example, build.sh, that runs GCC Toolset 15 commands.

About this task

In CI systems, you can integrate this pattern by running podman run as part of a pipeline step. Use pipeline variables or configuration files to provide the values for <REGISTRY>, <NAMESPACE>, <TAG>, and host paths.

Ensure build scripts write logs and artifacts to host-mounted directories. This practice enables CI systems and administrators to inspect outputs after the container exits and to archive them as needed.

Procedure

  1. Prepare your build workflow. Ensure both the source and output directories on the host have appropriate permissions.
  2. Run the container in noninteractive mode:
    $ podman run --rm -v /srv/src:/src -v /srv/build-output:/build-output -w /src <REGISTRY> / <NAMESPACE> /gcc-toolset-15: <TAG>  /src/build.sh

    In this example:

    • /src/build.sh is a script inside the container that performs the build.
    • Build artifacts and logs are written to /build-output, which maps to /srv/build-output on the host.