Chapter 4. Using the gcc-toolset-15 container image


The gcc-toolset-15 container image provides a complete toolchain for building, testing, and troubleshooting C and C++ applications in a containerized environment.

The gcc-toolset-15 container image provides a GCC Toolset 15 toolchain for building, testing, and troubleshooting C and C++ applications on Red Hat Enterprise Linux (RHEL). By using this image, you can mantain a reproducible environment without installing packages directly on the host.

The image is part of the RHEL container collection. All included RPM packages originate from official RHEL repositories, ensuring the image follows standard RHEL lifecycle and support policies. This provides a portable, containerized alternative to traditional RPM-based delivery.

Deployment scenarios include:

  • Interactive development on a RHEL host by running an interactive container that mounts source code from the host.
  • Noninteractive builds in CI pipelines or scheduled jobs, with build scripts running inside the container and writing artifacts to host-mounted directories.
  • Evaluation and troubleshooting of GCC Toolset 15 behavior in an isolated environment without installing the toolchain on the host.

The gcc-toolset-15 image targets the same architectures provided by Red Hat Enterprise Linux (RHEL), including AMD64 and Intel 64 (x86_64), 64-bit ARM (aarch64), IBM Power, little endian (ppc64le), and 64-bit IBM Z (s390x).

For image-specific metadata, supported architectures, and tags, see the Red Hat container catalog entry for the gcc-toolset-15 container image.

If you plan to deploy the image across multiple architectures, ensure that you choose a tag that includes multi-architecture support or use architecture-specific tags according to your organization’s standards.

The gcc-toolset-15 image is available from Red Hat container registries. The exact path can differ depending on whether you use public registries, internal mirrors, or both. This document uses placeholders for image locations:

  • <REGISTRY> for the registry hostname.
  • <NAMESPACE> for the registry namespace that contains the gcc-toolset-15 image.
  • <TAG> for the image tag that corresponds to the GCC Toolset 15 level that you require.

Use your product documentation, internal image catalog, or registry UI to determine the correct values for <REGISTRY>, <NAMESPACE>, and <TAG>. Record these values for use in the procedures in this document.

To configure hosts to use the gcc-toolset-15 image, verify system requirements and install necessary container tools. For comprehensive guidelines, see Building, running, and managing containers.

Prerequisites

  • Administrator access to the RHEL host.
  • The host is registered and has access to required Red Hat Enterprise Linux repositories.
  • The host runs a supported Red Hat Enterprise Linux variant and architecture.
  • Ensure that the host has adequated resources for CPU, memory, and storage for build workloads.
  • The host has network access to the container registry or to an internal mirror.

Procedure

  1. Install the container management tools:

    $ sudo dnf install -y container-tools
    Copy to Clipboard Toggle word wrap
  2. Verify that podman is available:

    $ podman --version
    Copy to Clipboard Toggle word wrap

    If the command completes successfully, it prints the version. For example:

    podman version 5.4.1
    Copy to Clipboard Toggle word wrap
  3. Verify subscription and repository access:

    $ sudo dnf repolist
    Copy to Clipboard Toggle word wrap

    If required, configure subscription settings according to your environment so that the host can consume RHEL content and container registries.

4.4. Authenticating to the container registry

To pull the gcc-toolset-15 image, you must log in to the container registry.

Prerequisites

  • container-tools are installed on the RHEL host.
  • You have the registry hostname and valid credentials.

Procedure

  1. Log in to the registry using podman:

    $ podman login <REGISTRY>
    Copy to Clipboard Toggle word wrap

    Replace <REGISTRY> with your registry hostname.

  2. When prompted, enter your user name and password, or use the authentication mechanism that your organization provides.

Verification

  • Verify that the login and registry access were successful by searching for the gcc-toolset-15 image:

    $ podman search <REGISTRY>/<NAMESPACE>/gcc-toolset-15**
    Copy to Clipboard Toggle word wrap

4.5. Pulling the gcc-toolset-15 container image

To use the gcc-toolset-15 image, pull it to your local system after authenticating to the registry.

Prerequisites

  • You have authenticated to the container registry.
  • You know the <REGISTRY>, <NAMESPACE>, and <TAG> values for the image. You can determine these details from the Red Hat Container Catalog or your internal image catalog.

Procedure

  1. Pull the image:

    $ podman pull <REGISTRY>/<NAMESPACE>/gcc-toolset-15:<TAG>
    Copy to Clipboard Toggle word wrap

    Replace <REGISTRY>, <NAMESPACE>, and <TAG> with the values you determined earlier.

Verification

  • Verify that the image is available locally:

    $ podman images <REGISTRY>/<NAMESPACE>/gcc-toolset-15
    Copy to Clipboard Toggle word wrap

    The output should display a table row containing the repository, tag, image ID, and size. For example:

    REPOSITORY                            TAG     IMAGE ID      CREATED     SIZE
    registry.redhat.io/.../gcc-toolset-15 latest  a1b2c3d4e5f6  2 days ago  540MB
    Copy to Clipboard Toggle word wrap

To use the gcc-toolset-15 image for interactive development, run an interactive container that mounts source code from the host.

Prerequisites

  • The gcc-toolset-15 image is available locally.
  • You have a host directory containing the application source code, for example, /home/devuser/src.
  • You have read and write permissions for the host directory.

Procedure

  1. Start an interactive container that mounts the source directory and uses it as the working directory:

    $ podman run --rm -it -v /home/devuser/src:/src -w /src <REGISTRY>/<NAMESPACE>/gcc-toolset-15:<TAG> /bin/bash
    Copy to Clipboard Toggle word wrap

    Replace <REGISTRY>, <NAMESPACE>, and <TAG> with your specific values.

  2. Inside the container, verify that the source code is available:

    # ls /src
    Copy to Clipboard Toggle word wrap
  3. Build an application using GCC Toolset 15:

    # gcc -o myapp main.c
    Copy to Clipboard Toggle word wrap

    Build artifacts created in /src are stored on the host in /home/devuser/src.

  4. When the interactive session completes, exit the shell:

    # exit
    Copy to Clipboard Toggle word wrap

    Because the container was started with the --rm flag, it is removed automatically.

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

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.

Prerequisites

  • 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.

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
    Copy to Clipboard Toggle word wrap

    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.

To maintain the gcc-toolset-15 image, monitor for updates including security fixes, bug fixes, and dependency changes. Track updates and errata by monitoring RHEL release notes, or internal advisories for new images that contain updated GCC Toolset 15 content.

Important
  • If you use an internal registry, mirror the updated image into the internal registry or rely on existing synchronization mechanisms.
  • Use internal paths for <REGISTRY> and <NAMESPACE> in all procedures.
  • Coordinate with the team that manages the internal registry to ensure that mirrors are updated inline with your rollout schedule.

Procedure

  1. Update to a new image tag: Consult the Red Hat Ecosystem Catalog or your internal registry to find the new image tag.

    1. Determine the <NEW_TAG> that corresponds to the updated gcc-toolset-15 image.
    2. Pull the new tag to your environment:

      $ podman pull <REGISTRY>/<NAMESPACE>/gcc-toolset-15:<NEW_TAG>
      Copy to Clipboard Toggle word wrap
    3. Update scripts, CI jobs, and documentation to reference <NEW_TAG> as appropriate.
  2. Remove outdated image tags after you complete validation and roll out the new tag, according to your retention policy:

    $ podman rmi <REGISTRY>/<NAMESPACE>/gcc-toolset-15:<OLD_TAG>
    Copy to Clipboard Toggle word wrap

Identify and resolve common issues when pulling or running the gcc-toolset-15 container image.

Common issues when pulling images

If podman pull fails:

  • Check registry login by running podman login <REGISTRY>.
  • Verify network connectivity to the registry.
  • Confirm that <REGISTRY>, <NAMESPACE>, and <TAG> values are correct.
  • If access is denied, verify that your subscription and registry permissions allow access to the gcc-toolset-15 image.
Common issues when running containers

If podman run fails:

  • Verify that the image is available locally by running podman images <REGISTRY>/<NAMESPACE>/gcc-toolset-15.

    The output should display a table row containing the repository, tag, image ID, and size. For example:

    REPOSITORY                            TAG     IMAGE ID      CREATED     SIZE
    registry.redhat.io/.../gcc-toolset-15 latest  a1b2c3d4e5f6  2 days ago  540MB
    Copy to Clipboard Toggle word wrap
  • Check volume mount paths to ensure that host directories exist and that you have appropriate permissions.
  • Review container exit codes and logs to identify script or compiler errors.
Collecting data for support

When opening a support case, collect the following data:

  • The exact podman commands that you ran.
  • Full command output and error messages.
  • The values of <REGISTRY>, <NAMESPACE>, and <TAG> that you used.
  • Information about the host, including Red Hat Enterprise Linux version and architecture.

Review the following operational and security guidelines when using the gcc-toolset-15 container image in your environment.

Network and registry access control
Ensure that hosts can access the required registries or internal mirrors and that firewall settings allow necessary connections. Use internal registries where possible to centralize control of images. Consult your internal documentation for details on your organization’s registry layout and CI integration patterns.
Resource management for build workloads
Build containers can be resource-intensive. Use cgroup controls, systemd integration, or container runtime options to manage CPU, memory, and I/O usage on shared hosts.
Logging and auditing containerized builds
Configure build scripts to write logs to host-mounted directories. Integrate these logs with your logging and auditing infrastructure to track build activity and diagnose issues.
Security and compliance guidelines

Because the gcc-toolset-15 image is built from Red Hat Enterprise Linux (RHEL) repositories, it follows RHEL security practices. However, you should still:

  • Limit who can run containers on shared hosts.
  • Periodically review and update image tags to consume security fixes.
  • Use internal registries and scanning tools according to your organization’s policies.
Red Hat logoGithubredditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust. Explore our recent updates.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

Theme

© 2026 Red Hat
Back to top