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-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/bashReplace
<REGISTRY>,<NAMESPACE>, and<TAG>with your specific values.Inside the container, verify that the source code is available:
# ls /srcBuild an application using GCC Toolset 15:
# gcc -o myapp main.cBuild artifacts created in
/srcare stored on the host in/home/devuser/src.When the interactive session completes, exit the shell:
# exitBecause the container was started with the
--rmflag, it is removed automatically.