4.6. Using the gcc-toolset-15 to run interactive development containers


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

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

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

    # ls /src
  3. Build an application using GCC Toolset 15:

    # gcc -o myapp main.c

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

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

    # exit

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

Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

关于红帽文档

Legal Notice

Theme

© 2026 Red Hat
返回顶部