Make a C compiler to use with Rust x CLion with Docker

1 Tools used

・ CLion ・ Docker for Windows

2 Docker

I wanted to touch Rust, so I installed it. It's not necessary if it's just a C compiler.

Dockerfile.


FROM ubuntu:18.04

RUN apt-get update \
  && apt-get install -y ssh \
      build-essential \
      gcc \
      g++ \
      gdb \
      clang \
      cmake \
      rsync \
      tar \
      python \
      apt-utils \
      git \
      less \
      neovim \
      sudo \
      curl \
      file \
  && apt-get clean

## install rust  
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y


SHELL ["/bin/bash", "-c"]
RUN source ~/.cargo/env
ENV PATH $PATH:~/.cargo/bin


## SSH-Settings
RUN ( \
    echo 'LogLevel DEBUG2'; \
    echo 'PermitRootLogin yes'; \
    echo 'PasswordAuthentication yes'; \
    echo 'Subsystem sftp /usr/lib/openssh/sftp-server'; \
  ) > /etc/ssh/sshd_config_clion \
  && mkdir /run/sshd

## SSH-User
RUN useradd -m user \
  && yes password | passwd user

CMD ["/usr/sbin/sshd", "-D", "-e", "-f", "/etc/ssh/sshd_config_clion"]

docker-compose.yml


version: '3'

services:
  remote_cpp:
    container_name: remote_cpp
    shm_size: 4096m
    build: "./"
    ports:
      - '2222:22'
    cap_add:
      - SYS_PTRACE
    tty: true

3 CLion

Select Toolchains from Settings and enter the release port on the Docker side, user / pass image.png

4 End

With VS Code's Remote Development, you can develop hard with just the above Docker, but isn't there such a function in the Jetbrains IDE?

Recommended Posts

Make a C compiler to use with Rust x CLion with Docker
[Rails] How to use rails console with docker
Create Docker to use Edge TPU compiler
[docker] [nginx] Make a simple ALB with nginx
How to run Blazor (C #) with Docker
How to build a Ruby on Rails development environment with Docker (Rails 6.x)
How to build a Ruby on Rails development environment with Docker (Rails 5.x)
How to make an app with a plugin mechanism [C # and Java]
How to use docker compose with NVIDIA Jetson
How to use nginx-ingress-controller with Docker for Mac
I tried to make a machine learning application with Dash (+ Docker) part3 ~ Practice ~
How to make a factory with a model with polymorphic association
[Introduction to Docker x ECS] ECS deployment with docker compose up
Considering a property editor to use with SpringToolSuite (STS)
Use Puphpeteer with Docker
Use ngrok with Docker
How to make Laravel faster with Docker for Mac
If you want to make a Java application a Docker image, it is convenient to use jib.
With podman in docker, everyone wants to get along and use docker on a shared computer
I tried to make an introduction to PHP + MySQL with Docker
Let's write how to make API with SpringBoot + Docker from 0
How to use a foreign key with FactoryBot ~ Another solution
Port C code with a lot of typecasts to Swift
[Beginner] Try to make a simple RPG game with Java ①
Make Docker confusing with Pokemon and make it easier to attach
I want to make a list with kotlin and java!
I want to make a function with kotlin and java!
Learning Ruby with AtCoder 13 How to make a two-dimensional array
How to get started with Gatsby (TypeScript) x Netlify x Docker
How to use mysql with M1 mac Docker preview version
Build a Node-RED environment with Docker to move and understand
I tried to create a padrino development environment with Docker
You are required to use winpty with docker exec [Windows]
Use GDAL with Python with Docker
[Docker] Use whenever with Docker + Rails
I tried to make a machine learning application with Dash (+ Docker) part2 ~ Basic way of writing Dash ~
I want to make a button with a line break with link_to [Note]
A tool to generate Retina images for iOS for use with Xcode
How to make a jar file with no dependencies in Maven
Try to make a cross-platform application with JRuby (jar file generation)
How to run a job with docker login in AWS batch
Use Jenkins to build inside Docker and then create a Docker image.
I tried to make a group function (bulletin board) with Rails
[For those who create portfolios] How to use binding.pry with Docker
I tried to make a machine learning application with Dash (+ Docker) part1 ~ Environment construction and operation check ~
Create a Vue3 environment with Docker!
Deploy a Docker application with Greengrass
Make a digging maze with Ruby2D
Build a Node.js environment with Docker
Try to make a simple callback
Make a slideshow tool with JavaFX
How to make a Java container
Why use orchestration tools with Docker
Make a Christmas tree with swift
How to make a JDBC driver
Hello World with Docker and C
Make a garbage reminder with line-bot-sdk-java
How to use mssql-tools with alpine
Make a list map with LazyMap
Operate a honeypot (Dionaea) with Docker
How to make a splash screen