Skip to content

Commit df34ed7

Browse files
authored
chore: added multi-editor packages and updated docs for air-gap mode … (coder#966)
1 parent cd6a7f9 commit df34ed7

File tree

1 file changed

+48
-16
lines changed

1 file changed

+48
-16
lines changed

guides/customization/multiple-jetbrains-ides.md

+48-16
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ description: Learn how to run multiple instances of JetBrains IDEs in Coder.
44
---
55

66
This article walks you through the process of configuring Coder to support the
7-
use of multiple instances of the same JetBrains IDE.
7+
use of multiple instances of the same JetBrains IDE using the JetBrains
8+
Projector CLI.
89

910
![Multiple IntelliJ icons in a
1011
workspace](../../assets/workspaces/multi-intellij-icons-smaller.png)
@@ -20,7 +21,7 @@ You will:
2021
This article shows you how to configure multiple instances of IntelliJ IDEA
2122
Ultimate, but you can use this process for any JetBrains IDEs.
2223

23-
> Using additional JetBrains IDEs consume extra workspace compute resources, so
24+
> Using additional JetBrains IDEs consumes extra workspace compute resources, so
2425
> ensure that you've allocated enough resources to your workspace to support all
2526
> of your IDE instances.
2627
@@ -41,6 +42,15 @@ Ultimate, but you can use this process for any JetBrains IDEs.
4142
# Create a symbolic link in PATH that points to the Intellij startup script.
4243
RUN ln -s /opt/idea/bin/idea.sh /usr/bin/intellij-idea-ultimate
4344

45+
# Packages required for JetBrains-in-a-browser support
46+
RUN apt-get update && \
47+
DEBIAN_FRONTEND="noninteractive" apt-get install -y \
48+
libxtst6 \
49+
libxrender1 \
50+
libfontconfig1 \
51+
libxi6 \
52+
libgtk-3-0
53+
4454
# bash .profile so projector can be added to the path
4555
COPY [".profile", "/coder/.profile"]
4656

@@ -55,17 +65,11 @@ Ultimate, but you can use this process for any JetBrains IDEs.
5565
USER coder
5666
```
5767

58-
1. Add the JetBrains Projector CLI to the workspace's PATH (in this example,
59-
`.profile` is located in the Coder directory within the directory that
60-
contains the image's Dockerfile:
61-
62-
```console
63-
export PATH=$PATH:$HOME/.local/bin
64-
```
65-
6668
1. Create the configure script that installs the Projector CLI into
67-
`/home/coder` and uses the CLI to install additional JetBrains IDEs. Each IDE
68-
configuration has a different directory in `/home/coder/.projector/configs`.
69+
`/home/coder` and uses the CLI to create additional JetBrains IDE config
70+
folders. Each IDE configuration has a different directory in
71+
`/home/coder/.projector/configs`.
72+
6973
In this example, the configure script is in the directory that contains the
7074
image's Dockerfile:
7175

@@ -75,10 +79,6 @@ Ultimate, but you can use this process for any JetBrains IDEs.
7579
# install projector into /home/coder/ pvc
7680
pip3 install projector-installer --user
7781

78-
# put projector CLI into path
79-
cp /coder/.profile $HOME
80-
source $HOME/.profile
81-
8282
# autoinstall intellij version specifying config name and port
8383
$HOME/.local/bin/projector --accept-license
8484

@@ -214,6 +214,38 @@ Ultimate, but you can use this process for any JetBrains IDEs.
214214
port: 8999
215215
```
216216
217+
The configure script example above auto-installs the JetBrains IDE into the
218+
`/home/coder` folder. If you have an air-gapped deployment or want to use the
219+
existing Coder-installed JetBrains IDE, replace the auto-install command with
220+
Projector's configure command:
221+
222+
```sh
223+
INTELLIJ_PATH=$HOME/.projector/apps/idea
224+
225+
if [ -d $INTELLIJ_PATH ]; then
226+
echo 'intellij IDE has already been copied - skip step'
227+
else
228+
echo 'copying Coder-installed JetBrains IntelliJ IDE into /home/coder'
229+
cp -R /opt/idea $HOME/.projector/apps
230+
fi
231+
232+
PROJECTOR_CONFIG_PATH=$HOME/.projector/configs/IntelliJ_2
233+
234+
if [ -d $PROJECTOR_CONFIG_PATH ]; then
235+
echo 'projector has already been configured - skip step'
236+
else
237+
echo 'creating projector config folders to support running multiple IntelliJ IDEs'
238+
$HOME/.local/bin/projector config add IntelliJ_2 $HOME/.projector/apps/idea --port 8997 --hostname=localhost --use-separate-config
239+
$HOME/.local/bin/projector config add IntelliJ_3 $HOME/.projector/apps/idea --port 8998 --hostname=localhost --use-separate-config
240+
$HOME/.local/bin/projector config add IntelliJ_4 $HOME/.projector/apps/idea --port 8999 --hostname=localhost --use-separate-config
241+
fi
242+
```
243+
244+
If you do not want to use workspace applications (i.e., the icons and
245+
`config.yaml` file), you can create dev URLs for each additional IntelliJ IDE
246+
and launch the `run.sh` script in `.projector/configs/<your config name>` on the
247+
appropriate port.
248+
217249
> See Projector's CLI documentation for additional information on
218250
> [installation](https://github.com/JetBrains/projector-installer#Installation)
219251
> and the

0 commit comments

Comments
 (0)