Giter VIP home page Giter VIP logo

cpp-devbox's Introduction

C++ DevBox GitHub Workflow Status

A Docker development box for C/C++.

Debian Linux 12 Bookworm with LLVM 17 & GCC 13, VulkanSDK 1.3.283.0, CMake, VCPKG, mold, zsh

Debian Linux 13 Trixie with LLVM 18 & GCC 13, VulkanSDK 1.3.283.0, CMake, VCPKG, mold, zsh

What is this?

This repository maintains Dockerfiles for generating two container images based on two Debian Linux versions.

One image includes GCC and LLVM (container size: ~2GB).

The other image includes GCC, LLVM, and Vulkan SDK (container size: ~4GB).

Both images are build using Debian 12 Bookworm and Debian 13 Trixie.

All images are published to the Github Container Registry (GHCR).

The purpose of these images is to setup a C++ development environment within Visual Studio Code using a devcontainer config.

What is pre-installed?

Here is a basic overview of the pre-installed tools. For details, please refer to the Dockerfiles.

On top of the base image the following tools are installed:

  • zsh with plugins: autosuggestions, completions, history substring search
  • git, nano, jq
  • curl, wget
  • cppcheck, valgrind, ccache
  • CMake
  • vcpkg (latest version)
  • mold (lastet version)

The following C/C++ compilers and their toolchains are available:

  • LLVM 17.0.2
  • GCC 12.2.0
  • GCC 13.2.0

The following C/C++ compilers and their toolchains are available:

  • LLVM 18
  • GCC 13.2.0

VulkanSDK

The with-vulkansdk image additionally contains:

  • Vulkan SDK 1.3.283.0

Prerequisites

You need the following things to run this:

  • Docker
  • Visual Studio Code

How to run this?

There are two ways of setting the container up.

Either by building the container image locally or by fetching the prebuild container image from the Github container registry.

Building the Container Image locally using VSCode

  • Step 1. Get the source: clone this repository using git or download the zip

  • Step 2. In VSCode open the folder in a container (Remote Containers: Open Folder in Container):

    This will build the container image (Starting Dev Container (show log): Building image..)

    Which takes a while...

    Then, finally...

  • Step 3. Enjoy! 😎

Fetching the prebuild container images using Docker

This container image is published to the Github Container Registry (GHCR).

You may find the package here: https://github.com/jakoch/cpp-devbox/pkgs/container/cpp-devbox.

Command Line

You can install the container image from the command line:

docker pull ghcr.io/jakoch/cpp-devbox:bookworm-latest

For the image containing Vulkan SDK append with-vulkansdk-latest:

docker pull ghcr.io/jakoch/cpp-devbox:bookworm-with-vulkansdk-latest

Dockerfile

You might also use this container image as a base image in your own Dockerfile:

FROM ghcr.io/jakoch/cpp-devbox:bookworm-latest

Fetching the prebuild container images using a .devcontainer config

Devcontainer.json

You might use this container image in the .devcontainer/devcontainer.json file of your project:

{
  "name": "My C++ Project DevBox",
  "image": "ghcr.io/jakoch/cpp-devbox:bookworm-latest"
}

Devcontainer.json + with-vulkansdk image

You might use this container image in the .devcontainer/devcontainer.json file of your project:

{
  "name": "My C++ Project DevBox",
  "image": "ghcr.io/jakoch/cpp-devbox:bookworm-with-vulkansdk-latest"
}

Developer Notes

Fetching the bleeding-edge prebuild container images

The bleeding-edge container versions are build using Debian 13 - Trixie.

The Trixie base image ships GCC 13.2 and LLVM 16 by default. For GCC its also the latest available upstream version. For LLVM we installed the latest available upstream version: LLVM 18.

These images are unstable because:

  • a) the Debian base image Trixie itself unstable,
  • b) LLVM 18 has package requirements, which can not be resolved with Trixie packages alone, so several Debian SID packages are required.

Versioning Scheme for Images

The container images use the following versioning scheme.

Scheduled Builds

The following container tags are created for scheduled builds:

  • ghcr.io/jakoch/cpp-devbox:{debian_codename}-nightly-{{date}}
  • ghcr.io/jakoch/cpp-devbox:{debian_codename}-with-vulkansdk-nightly-{{date}}

For git push

The following container tags are created only on push, not when tagging:

  • ghcr.io/jakoch/cpp-devbox:{debian_codename}-with-vulkansdk-{{date}}-sha-{{sha}}
  • ghcr.io/jakoch/cpp-devbox:{debian_codename}-{{date}}-sha-{{sha}}

For git tag

The following container tags are created for git tags:

  • ghcr.io/jakoch/cpp-devbox:{debian_codename}-{{ version }}

  • ghcr.io/jakoch/cpp-devbox:{debian_codename}-{{ major }}.{{ minor }}

  • ghcr.io/jakoch/cpp-devbox:{debian_codename}-with-vulkansdk-{{ version }}

  • ghcr.io/jakoch/cpp-devbox:{debian_codename}-with-vulkansdk-{{ major }}.{{ minor }}

Latest

The container tag "latest" is applied to the latest build:

  • ghcr.io/jakoch/cpp-devbox:{debian_codename}-latest
  • ghcr.io/jakoch/cpp-devbox:{debian_codename}-with-vulkansdk-latest

cpp-devbox's People

Contributors

dependabot[bot] avatar jakoch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

cpp-devbox's Issues

add mold linker

add https://github.com/rui314/mold

RUN cd /opt && \
    git clone https://github.com/rui314/mold.git && \
    cd mold && \
    git checkout v2.31.0 && \
    ./install-build-deps.sh && \
    mkdir build && cd build && \
    cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=clang++ .. && \
    cmake --build . -j $(nproc) && \
    cmake --install .

add badges

⭣ Version    OS ⭢ Debian 12 - Bookworm Debian 13 - Trixie
Latest v1.0.2 v1.0.2
Latest "with-vulkansdk" with-vulkansdk-v1.0.2 with-vulkansdk-v1.0.2
v1.0.3 v1.0.3 v1.0.3
v1.0.3 "with-vulkansdk" v1.0.3 with-vulkansdk-v1.0.3

add gcc 14

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.