项目作者: invasy

项目描述 :
Remote Development Environment for CLion
高级语言: Dockerfile
项目地址: git://github.com/invasy/clang-remote.git
创建时间: 2021-06-20T10:27:18Z
项目社区:https://github.com/invasy/clang-remote

开源协议:

下载


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

  1. 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:

  1. 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

  1. # ~/.ssh/config
  2. Host clang-remote
  3. User builder
  4. HostName 127.0.0.1
  5. Port 22001
  6. HostKeyAlias clang-remote
  7. StrictHostKeyChecking no
  8. NoHostAuthenticationForLocalhost yes
  9. PreferredAuthentications password
  10. PasswordAuthentication yes
  11. PubkeyAuthentication no

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

  1. ssh-keygen -f "$HOME/.ssh/known_hosts" -R "clang-remote"

Connection

  1. ssh clang-remote

Password: builder

See Also