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.
4.1. Introduction to the gcc-toolset-15 container image Copy linkLink copied to clipboard!
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.
4.2. Supported platforms and architectures for the gcc-toolset-15 container image Copy linkLink copied to clipboard!
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 thegcc-toolset-15image. -
<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.
4.3. Preparing a RHEL host for the gcc-toolset-15 container image Copy linkLink copied to clipboard!
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
Install the container management tools:
sudo dnf install -y container-tools
$ sudo dnf install -y container-toolsCopy to Clipboard Copied! Toggle word wrap Toggle overflow Verify that
podmanis available:podman --version
$ podman --versionCopy to Clipboard Copied! Toggle word wrap Toggle overflow If the command completes successfully, it prints the version. For example:
podman version 5.4.1
podman version 5.4.1Copy to Clipboard Copied! Toggle word wrap Toggle overflow Verify subscription and repository access:
sudo dnf repolist
$ sudo dnf repolistCopy to Clipboard Copied! Toggle word wrap Toggle overflow 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 Copy linkLink copied to clipboard!
To pull the gcc-toolset-15 image, you must log in to the container registry.
Prerequisites
-
container-toolsare installed on the RHEL host. - You have the registry hostname and valid credentials.
Procedure
Log in to the registry using
podman:podman login <REGISTRY>
$ podman login <REGISTRY>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace
<REGISTRY>with your registry hostname.- 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-15image:podman search <REGISTRY>/<NAMESPACE>/gcc-toolset-15**
$ podman search <REGISTRY>/<NAMESPACE>/gcc-toolset-15**Copy to Clipboard Copied! Toggle word wrap Toggle overflow
4.5. Pulling the gcc-toolset-15 container image Copy linkLink copied to clipboard!
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
Pull the image:
podman pull <REGISTRY>/<NAMESPACE>/gcc-toolset-15:<TAG>
$ podman pull <REGISTRY>/<NAMESPACE>/gcc-toolset-15:<TAG>Copy to Clipboard Copied! Toggle word wrap Toggle overflow 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
$ podman images <REGISTRY>/<NAMESPACE>/gcc-toolset-15Copy to Clipboard Copied! Toggle word wrap Toggle overflow 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
REPOSITORY TAG IMAGE ID CREATED SIZE registry.redhat.io/.../gcc-toolset-15 latest a1b2c3d4e5f6 2 days ago 540MBCopy to Clipboard Copied! Toggle word wrap Toggle overflow
4.6. Using the gcc-toolset-15 to run interactive development containers Copy linkLink copied to clipboard!
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-15image 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
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
$ podman run --rm -it -v /home/devuser/src:/src -w /src <REGISTRY>/<NAMESPACE>/gcc-toolset-15:<TAG> /bin/bashCopy to Clipboard Copied! Toggle word wrap Toggle overflow Replace
<REGISTRY>,<NAMESPACE>, and<TAG>with your specific values.Inside the container, verify that the source code is available:
ls /src
# ls /srcCopy to Clipboard Copied! Toggle word wrap Toggle overflow Build an application using GCC Toolset 15:
gcc -o myapp main.c
# gcc -o myapp main.cCopy to Clipboard Copied! Toggle word wrap Toggle overflow Build artifacts created in
/srcare stored on the host in/home/devuser/src.When the interactive session completes, exit the shell:
exit
# exitCopy to Clipboard Copied! Toggle word wrap Toggle overflow Because the container was started with the
--rmflag, it is removed automatically.
4.7. Running noninteractive builds with gcc-toolset-15 Copy linkLink copied to clipboard!
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-15image 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
- Prepare your build workflow. Ensure both the source and output directories on the host have appropriate permissions.
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
$ podman run --rm -v /srv/src:/src -v /srv/build-output:/build-output -w /src <REGISTRY> / <NAMESPACE> /gcc-toolset-15: <TAG> /src/build.shCopy to Clipboard Copied! Toggle word wrap Toggle overflow In this example:
-
/src/build.shis a script inside the container that performs the build. -
Build artifacts and logs are written to
/build-output, which maps to/srv/build-outputon the host.
-
4.8. Maintaining the gcc-toolset-15 container image Copy linkLink copied to clipboard!
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.
- 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
Update to a new image tag: Consult the Red Hat Ecosystem Catalog or your internal registry to find the new image tag.
-
Determine the
<NEW_TAG>that corresponds to the updatedgcc-toolset-15image. Pull the new tag to your environment:
podman pull <REGISTRY>/<NAMESPACE>/gcc-toolset-15:<NEW_TAG>
$ podman pull <REGISTRY>/<NAMESPACE>/gcc-toolset-15:<NEW_TAG>Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Update scripts, CI jobs, and documentation to reference
<NEW_TAG>as appropriate.
-
Determine the
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>
$ podman rmi <REGISTRY>/<NAMESPACE>/gcc-toolset-15:<OLD_TAG>Copy to Clipboard Copied! Toggle word wrap Toggle overflow
4.9. Troubleshooting the gcc-toolset-15 container image Copy linkLink copied to clipboard!
Identify and resolve common issues when pulling or running the gcc-toolset-15 container image.
- Common issues when pulling images
If
podman pullfails:-
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-15image.
-
Check registry login by running
- Common issues when running containers
If
podman runfails: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
REPOSITORY TAG IMAGE ID CREATED SIZE registry.redhat.io/.../gcc-toolset-15 latest a1b2c3d4e5f6 2 days ago 540MBCopy to Clipboard Copied! Toggle word wrap Toggle overflow - 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
podmancommands 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.
-
The exact
4.10. Operational and security considerations for the gcc-toolset-15 container image Copy linkLink copied to clipboard!
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,
systemdintegration, 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-15image 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.