Latest gcc and clang bundled into one container to try out modern C++ features.
10K+
Docker Containers Intended for Use with the C++ 23 Masterclass IMPORTANT NOTE:
You need to have Docker installed on your machine to use these containers
Environment:
GCC 14.2
Clang 18
CMake 3.30
Ninja 1.12.1
Vcpkg
We set up the VCPKG_ROOT environment variable to point to the root folder of vcpkg
Debuggers: GDB
How to use:
The are two ways to use the containers:
Build the container using the Dockerfile provided
Pull the container from Docker Hub
Pulling the container from Docker Hub:
Run the following command:
docker pull dgakwaya/gcc_clang
Run the command to start the container, pointing the folder containing the code to the /workspace folder in the container:
docker run -it -v <path_to_code>:/workspace dgakwaya/gcc_clang
eg: docker run -it --name gcc_clang -v D:\Sandbox\The-C-20-Masterclass-Source-Code:/workspace dgakwaya/gcc_clang
By this point, you should be in the container and ready to compile your code.
Connect VS Code to the container:
You can connect VS Code to the container by following these steps:
Install the Remote - Containers extension in VS Code
Open the folder containing the code in VS Code
Click on the green icon at the bottom left corner of the window
Select "Attach to Running Container"
Select the container you want to connect to
Open a folder in the container
Install the needed extensions in the container
C/C++
CMake
CMake Tools
By this point, you should be connected to the container and ready to compile your code.
Things you can do:
Select a configure preset
Windows-cl
Linux-gcc
Linux-clang
Build:
Hit the build button in the bottom left corner of the window
Debug:
Set up a break point
Hit the debug button on the bottom bar
Known Issues:
The gcc compiler (GCC 14.2) is not compiling module code that uses the fmt library
You can get around that by just falling back to iostream, or using the clang compiler
We'll update the container as soon as we find a solution
Content type
Image
Digest
sha256:031d54d13…
Size
948.2 MB
Last updated
over 1 year ago
docker pull dgakwaya/gcc-clang