Skip to content

Latest commit

 

History

History
124 lines (104 loc) · 5.1 KB

README.md

File metadata and controls

124 lines (104 loc) · 5.1 KB

C/C++ Development Environments with clang

invasy/dev-env-clang @ DockerHub Docker Image Size (latest by date) Docker Pulls

ghcr.io/invasy/dev-env-clang @ GitHub Container Registry

registry.gitlab.com/invasy/dev-env/clang @ GitLab Container Registry

Parent image: invasy/dev-env-cpp.

Toolchain

Tool Version
Debian (slim) 11.4 (Bullseye)
[GPG] 2.2.27
[libgcrypt] 1.8.8
OpenSSH server 8.4p1
rsync 3.2.3
CMake 3.23.5
ninja 1.11.1
GNU Make 4.3
GNU Debugger (gdb) with gdbserver 10.1
clang/llvm 14

Usage

  1. Build image:
    make build-clang
  2. Run service:
    make up-clang
  3. Set up CLion toolchain (see below).
  4. Build, run, debug your project using toolchain in the container.
  5. Stop service:
    make down-clang

CLion Configuration

Toolchains

Toolchains

  • Name: dev-env-clang
  • Credentials: see SSH Configurations below
  • CMake: /usr/local/bin/cmake
  • Make: /usr/local/bin/ninja (see also CMake below)
  • C Compiler: /usr/bin/clang-14 (should be detected)
  • C++ Compiler: /usr/bin/clang++-14 (should be detected)
  • Debugger: /usr/bin/gdb (should be detected)

SSH Configurations

SSH Configurations

  • Host: 127.0.0.1
  • Port: 22001
  • Authentication type: Password
  • User name: builder
  • Password: builder

CMake

CMake

  • Profiles:
    • Debug (or any other profile):
      • CMake options: -G Ninja

SSH

Configuration

# ~/.ssh/config
Host dev-env-clang
User builder
HostName 127.0.0.1
Port 22001
HostKeyAlias dev-env-clang
StrictHostKeyChecking no
NoHostAuthenticationForLocalhost yes
PreferredAuthentications password
PasswordAuthentication yes
PubkeyAuthentication no

Remove old host key from ~/.ssh/known_hosts after image rebuilding (note HostKeyAlias in config above):

ssh-keygen -f "$HOME/.ssh/known_hosts" -R 'dev-env-clang'

Connection

ssh dev-env-clang
  • User name: builder
  • Password: builder

See Also