A custom Docker image containing the theia-ide for Java development
1.2K
A custom Docker image containing the theia-ide for Java / Javascript development. If you don't know what Eclipse Theia is, here is their official description: "An Open, Flexible and Extensible Cloud & Desktop IDE Platform". Think vscode, but running on your browser instead.
There used to be an "official" theia docker image for Java developers, but this is not being developed anymore. We were left with some options like php, dart, python or event the full docker image that has Java support, but it is huge. Therefore, I decided to revamp this project to update it, improve security and further reduce its size.
Pre-installed extensions (using Open Vsx Registry):
$ docker run -d --name theia-java -p 3030:3030 -p 8080:8080 raonigabriel/theia-java
Notice that on this example, we're mapping port 3030, to access the theia-app from the host. We are also mapping port 8080 to access the app being developed (say, a SpringBoot app) from the host. Then open your browser: http://localhost:3030
The theia app running inside the container is NOT password protected and uses HTTP (no encryption). If you want to add security, please use a reverse-proxy like nginx or Caddy and enable some kind of authentication and SSL. In case you decide to do so, keep in mind that you will also need to forward the websocket theia uses.
Lets say you want to add a tool (docker cli for an example): First, create a Dockerfile like this:
FROM raonigabriel/theia-java
# Change the user to root to install packages with apk
USER root
RUN apk add --no-cache docker-cli
# Go back to the theia user
USER theia
Build your custom image:
$ docker build . -t my-custom-theia
Then run it:
$ docker run -d -v /var/run/docker.sock:/var/run/docker.sock -p 3030:3030 -p 8080:8080 my-custom-theia
Notice that for this specific scenario, the docker cli inside the container will need access to the Unix domain socket of the docker host, as we're would be running "docker-in-docker", aka dind. Hence, we bind mount it as: -v /var/run/docker.sock:/var/run/docker.sock Keep in mind that this is equivalent off giving root privileges on your host to the container.
Content type
Image
Digest
Size
454.6 MB
Last updated
almost 5 years ago
docker pull raonigabriel/theia-java