Quick Start with Eclipse Che – Browser based IDE, running on Docker

0

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

image

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.

image

I select the stack Node, set a name for a new workspace and click on Create:

image

The newly created workspace appears. Click on Open.

image

The workspace was opened.

image

Note: the workspace is running in its own Docker container:

image

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.

SNAGHTML2bde3ae7

Select NodeJS as project template, set the name and click Create.

The new project is created, with a sample hello.js file:

image

This simple file listens for HTTP requests at port 9000. We can run that Node application, for example from the terminal

SNAGHTML2be2d56e

Now the Node application can be accessed from the browser on my Windows machine, at port 32792:

image

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:

image

Resources

Eclipse Che Website: https://www.eclipse.org/che/ 

Eclipse Che documentation: https://www.eclipse.org/che/docs/index.html

About Author

Lucas Jellema, active in IT (and with Oracle) since 1994. Oracle ACE Director and Oracle Developer Champion. Solution architect and developer on diverse areas including SQL, JavaScript, Kubernetes & Docker, Machine Learning, Java, SOA and microservices, events in various shapes and forms and many other things. Author of the Oracle Press book Oracle SOA Suite 12c Handbook. Frequent presenter on user groups and community events and conferences such as JavaOne, Oracle Code, CodeOne, NLJUG JFall and Oracle OpenWorld.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.