Skip to content

Instantly share code, notes, and snippets.

Last active October 24, 2023 20:59
Show Gist options
  • Save khalidabuhakmeh/20efbdff6eed1b8014884b681fb4716b to your computer and use it in GitHub Desktop.
Save khalidabuhakmeh/20efbdff6eed1b8014884b681fb4716b to your computer and use it in GitHub Desktop.
JetBrains Rider / Gateway Container
# SSHD port
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y apt-utils apt-transport-https
RUN apt-get install -y \
# Utilities \
curl unzip wget software-properties-common socat man-db gnupg2 pass lsof procps time \
# VCS \
git \
# Docker \
docker docker-compose \
# SSHD \
openssh-server \
&& rm -rf /var/lib/apt/lists/*
RUN true \
&& set -e \
&& mkdir /var/run/sshd \
&& sed -ri 's/^#?PermitRootLogin\s+.*/PermitRootLogin yes/' /etc/ssh/sshd_config \
&& sed -ri 's/UsePAM yes/#UsePAM yes/g' /etc/ssh/sshd_config \
&& echo 'root:root' | chpasswd
CMD /usr/sbin/sshd -D

How To Use

Requirements before starting:

  1. Docker for Desktop
  2. JetBrains Gateway or JetBrains Rider

Seriously though, just download JetBrains Toolbox

Download Dockerfile

From above, download the Dockerfile and add it to a folder/location on your disk. You'll need it for the next step.

Building and Running the container

Run the following in a terminal.

docker build -t rdev .
docker run -it -p 2222:22 rdev

Connect using JetBrains Rider

  1. From the welcome screen of Rider, select New Connection.

  2. Set the following values for the fields. a. Username : root b. Host: localhost c. Port: 2222 d. Password (prompt): root

Screenshot 2022-04-19 at 15 19 20

  1. Connect to your new container and git clone a .NET 6 project. Use open an SSH terminal link
  2. Set the Project Directory to the path of your .sln or .csproj file. (for example:

Screenshot 2022-04-19 at 15 23 09

  1. Click Download and Start IDE.

Have Fun!

Copy link

MO2k4 commented Apr 19, 2022

this is awesome! i did a prepare build for the installation of the ide with an empty solution, this way one image could be reused for several projects without the need to reinstall the ide each time

steps for reproduction:

  • build image with an empty solution file (mkdir default && cd default && dotnet new sln)
  • start this image
  • connect through gateway app or rider to this container and let the ide installation go through
  • save current state of the container (docker commit )

Copy link

I was trying this but got stuck at downloading the IDE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment