Chapter 15. Using the GCC Toolset container images
The GCC Toolset 10 components are available in the two container images:
- GCC Toolset 10 Toolchain
- GCC Toolset 10 Perftools
The GCC Toolset container images are based on the rhel8
base image and are available for all architectures supported by RHEL 8:
- AMD and Intel 64-bit architectures
- The 64-bit ARM architecture
- IBM Power Systems, Little Endian
- IBM Z
15.1. GCC Toolset container images contents
Tools versions provided in the GCC Toolset 10 container images match the GCC Toolset 10 components versions.
The GCC Toolset 10 Toolchain contents
The rhel8/gcc-toolset-10-toolchain
image provides the GCC compiler, the GDB debugger, and other development-related tools. The container image consists of the following components:
Component | Package |
---|---|
| gcc-toolset-10-gcc |
| gcc-toolset-10-gcc-c++ |
| gcc-toolset-10-gcc-gfortran |
| gcc-toolset-10-gdb |
The GCC Toolset 10 Perftools contents
The rhel8/gcc-toolset-10-perftools
image provides a number of tools for debugging, performance monitoring, and further analysis of the applications. The container image consists of the following components:
Component | Package |
---|---|
| gcc-toolset-10-valgrind |
| gcc-toolset-10-systemtap |
| gcc-toolset-10-dyninst |
| gcc-toolset-10-elfutils |
Additional resources
- To use the GCC Toolset components on RHEL 7, use Red Hat Developer Toolset that provides similar developer tools for RHEL 7 users — Red Hat Developer Toolset user guide.
- Instructions on using the Red Hat Developer Toolset container images on RHEL 7 — Red Hat Developer Toolset images.
15.2. Accessing and running the GCC Toolset container images
The following section describes how to access and run the GCC Toolset container images.
Prerequisites
- Podman is installed.
Procedure
Access the Red Hat Container Registry using your Customer Portal credentials:
$ podman login registry.redhat.io Username: username Password: ********
Pull a container image you require by running a relevant command as root:
# podman pull registry.redhat.io/rhel8/gcc-toolset-10-toolchain
# podman pull registry.redhat.io/rhel8/gcc-toolset-10-perftools
NoteOn RHEL 8.1 and later versions, you can set up your system to work with containers as a non-root user. For details, see Running containers as root or rootless.
Optional: Check that pulling was successful by running a command that lists all container images on your local system:
# podman images
Run a container by launching a bash shell inside a container:
# podman run -it image_name /bin/bash
The
-i
option creates an interactive session; without this option the shell opens and instantly exits.The
-t
option opens a terminal session; without this option you cannot type anything to the shell.
Additional resources
- Building, running, and managing Linux containers on RHEL 8
- A Red Hat blog article — Understanding root inside and outside a container
- Entries in the Red Hat Container Registry — GCC Toolset container images
15.3. Example: Using the GCC Toolset 10 Toolchain container image
This example shows how to pull and start using the GCC Toolset 10 Toolchain container image.
Prerequisites
- Podman is installed.
Procedure
Access the Red Hat Container Registry using your Customer Portal credentials:
$ podman login registry.redhat.io Username: username Password: ********
Pull the container image as root:
# podman pull registry.redhat.io/rhel8/gcc-toolset-10-toolchain
Launch the container image with an interactive shell as root:
# podman run -it registry.redhat.io/rhel8/gcc-toolset-10-toolchain /bin/bash
Run the GCC Toolset tools as expected. For example, to verify the
gcc
compiler version, run:bash-4.4$ gcc -v ... gcc version 10.2.1 20200804 (Red Hat 10.2.1-2) (GCC)
To list all packages provided in the container, run:
bash-4.4$ rpm -qa