Skip to content
This repository has been archived by the owner on Nov 20, 2022. It is now read-only.
/ docker-clang Public archive

Remote Development Environment for CLion (C/C++) with clang (LLVM), CMake, Ninja, GNU Make, GDB

Notifications You must be signed in to change notification settings

invasy/docker-clang

Repository files navigation

Remote Development Environment for CLion

Warning: Development continues in invasy/dev-env repository.

Toolchain

Note: CMake versions 3.21.* are not supported by CLion versions up to 2021.2.*.

Usage

  1. Run service (container).
  2. Set up CLion toolchain.
  3. Build, run, debug your project in the container.

Run container

docker run -d --cap-add=sys_admin --name=clang_remote -p 127.0.0.1:22001:22 invasy/clang-remote:latest

or from git repository:

docker-compose up -d

CLion Configuration

Toolchains

Toolchains

  • Name: clang-remote
  • Credentials: see SSH Configurations below
  • CMake: /usr/local/bin/cmake
  • Make: /usr/local/bin/ninja (see also CMake below)
  • C Compiler: /usr/bin/clang-13 (should be detected)
  • C++ Compiler: /usr/bin/clang++-13 (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 clang-remote
User builder
HostName 127.0.0.1
Port 22001
HostKeyAlias clang-remote
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 "clang-remote"

Connection

ssh clang-remote

Password: builder

See Also