/docker-gcc

Remote Development Environment for CLion with GCC and CMake

Primary LanguageDockerfile

Remote Development Environment for CLion with GCC and CMake

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=gcc_remote -p 127.0.0.1:22002:22 invasy/gcc-remote:latest

or from git repository:

docker-compose up -d

CLion Configuration

Toolchains

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

SSH Configurations

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

CMake

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

SSH

Configuration

# ~/.ssh/config
Host gcc-remote
User builder
HostName 127.0.0.1
Port 22002
HostKeyAlias gcc-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 "gcc-remote"

Connection

ssh gcc-remote

Password: builder

See Also