One of the nice discoveries I made last week during CodeOne 2018 was Eclipse Che. This is a browser based polyglot IDE that runs in a Docker container – either locally, on a central server or in the cloud, on a stand alone Docker engine, a Kubernetes or an OpenShift cluster. Running Eclipse Che is quite easy, upgrading and removing Eclipse Che is just as easy. Working in a browser based IDE does not have the exact same feel and experience as a desktop application – but it comes close. And the ease of getting it going, of managing it for a larger team and of working a in clean, separated environment is very appealing. Additionally, having workspaces run in their own containers makes for another clean, separated approach that perhaps helps with better performance and quicker dev-test-roundtrips.
Anyway, here are some quick notes from my first steps with Eclipse Che on my own machine:
I am running a Docker host in an Ubuntu Virtual Machine managed by Vagrant. A local directory is mapped into the VM.
Run a single Docker command to start Eclipse Che:
docker run -it --rm -e CHE_HOST=192.168.188.120 -v /var/run/docker.sock:/var/run/docker.sock -v /vagrant:/data eclipse/che start
The ip-address set on the CHE_HOST environment variable is the address set for the Virtual Machine managed by Vagrant. The directory /vagrant is mapped from my Windows host into the Ubuntu VM.
Container images are downloaded and started, checks are performed. At some point the Che container is running.
Now I can access the Che IDE in my browser – on my Windows host at http://192.168.188.120:8080.
I select the stack Node, set a name for a new workspace and click on Create:
The newly created workspace appears. Click on Open.
The workspace was opened.
Note: the workspace is running in its own Docker container:
Note how port 9000 is mapped to port 32792 on the Docker Host. This means that any application running in this workspace (container) and listening at port 9000 will be accessible at port 32792 on my laptop’s Windows host .
Click on Create Project.
Select NodeJS as project template, set the name and click Create.
The new project is created, with a sample hello.js file:
This simple file listens for HTTP requests at port 9000. We can run that Node application, for example from the terminal
Now the Node application can be accessed from the browser on my Windows machine, at port 32792:
Granted, in terms of application development, this is really only scratching the surface. But in terms of IDE management and dev-test-run roundtrips, this is quite impressive. Note that I used a single Docker run command to run my IDE. The only preparation I had performed was running a Linux VM with a Docker engine installed.
Eclipse Che also runs on Kubernetes and OpenShift and of course its host can be local, a private data center or a cloud environment.
Finally, because of the volume mapping to a directory on the Linux Docker host machine that is actually shared from my Windows laptop, the files created by Eclipse Che live and persist on my laptop:
Eclipse Che Website: https://www.eclipse.org/che/
Eclipse Che documentation: https://www.eclipse.org/che/docs/index.html