Giter Club home page Giter Club logo

docker-emacs-eclim's Introduction

docker-emacs-eclim

Enterprise Java development in Emacs running in a Docker container

This container is powered by the following open source software products:

  • Emacs 26
  • Eclipse Oxygen with OpenJDK 8
  • eclim -- eclim brings Eclipse functionality to the Vim editor

phusion/baseimage is used as the base image.

Build the Docker Image

$ docker build -t emacs-eclim .

Running the Docker Container

After building, you can just pull the image and run it.

$ docker run -it --name=emacs-eclim \
             -p 8080:8080 \
             emacs-eclim:latest \
             /sbin/my_init -- su - docker

This will start xvfb service in order to create a fake display for Eclipse, and then drop you in a shell with docker user.

Start Eclipse via eclimd

Inside the container, start Eclipse via eclimd.

$ DISPLAY=:1 ./eclipse/eclimd

You should wait for the following message before connecting from Vim.

INFO  [org.eclim.eclipse.EclimDaemon] Eclim Server Started on: 127.0.0.1:9091

Alternatively, you can start eclimd with background option.

$ DISPLAY=:1 ./eclipse/eclimd -b

Start Vim

$ emacs

TODO - add first eclim step

Persisting Your Projects with Docker Volumes

Since this is a Docker environment, you will lose all changes in your container when you kill it (unless you do docker commit).

You can use Docker volumes with bind mount to map the host directories/files to the container.

For example,

$ docker run -it --name=emacs-eclim \
             -v /path/to/myproject:/home/docker/workspace/myproject \
             vim-eclim:latest \
             /sbin/my_init -- su - docker

Then change the owner of the project folder and files in the container

$ sudo chown -R docker:docker ~/workspace/myproject

My Java projects are mirrored in remote git repositories via ssh access and some of them uses Maven or Ivy. So I usually start the container with something like the following:

$ docker run -it --name=vim-eclim \
             -v /path/to/myproject:/home/docker/workspace/myproject \
             -v /path/to/ssh:/home/docker/.ssh \
             -v /path/to/gitconfig:/home/docker/.gitconfig \
             -v /path/to/m2:/home/docker/.m2 \
             -v /path/to/ivy2:/home/docker/.ivy2 \
             vim-eclim:latest \
             /sbin/my_init -- su - docker

For further details about Docker volumes, see the Docker Cheat-Sheet

Special Thanks!

This Docker images was inspired by the following project:

docker-emacs-eclim's People

Contributors

nigol avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.