Coder Social home page Coder Social logo

docker-intellij's Introduction

Docker image for IntelliJ IDEA Community, Go and Go plugin

Circle CI

The image contains the following software:

Running

NOTE As of Docker 1.10(?) you need to specify full paths for mounts.

By running the following command you'll be able to start the container

docker run -tdi \
           --net="host" \
           --privileged=true \
           -e DISPLAY=${DISPLAY} \
           -v /tmp/.X11-unix:/tmp/.X11-unix \
           -v ${HOME}/.IdeaIC2016.1_docker:/home/developer/.IdeaIC2016.1 \
           -v ${GOPATH}:/home/developer/go \
           dlsniper/docker-intellij

The command will do the following:

  • save the IDE preferences into <your-HOME-dir>/.IdeaIC2016.1_docker
  • mounts the GOPATH from your computer to the one in the container. This assumes you have a single directory. If you have multiple directories in your GOPATH, then see below how you can customize this to run correctly.

Customizing the container

You can replace the ${GOPATH} environment variable to a hardcoded path that you have in your directory.

You can also choose to save the preferences in another directory.

For an example script to launch this, see below:

#!/usr/bin/env bash

GOPATH=/path/to/your/GOPATH
PREF_DIR=${HOME}/.IdeaIC2016.1_docker

docker run -tdi \
           --net="host" \
           --privileged=true \
           -e DISPLAY=${DISPLAY} \
           -v /tmp/.X11-unix:/tmp/.X11-unix \
           -v ${PREF_DIR}:/home/developer/.IdeaIC2016.1 \
           -v ${GOPATH}:/home/developer/go \
           dlsniper/docker-intellij

Updating the container

To update the container, simply run:

docker pull dlsniper/docker-intellij

Each of the plugins can be updated individually at any time, and other plugins can be installed as well.

However, to update IntelliJ IDEA itself, the docker image will need to be updated.

License

The MIT License (MIT)

Copyright (c) 2016 Florin Patan

If you want to read the full license text, please see the LICENSE file in this directory.

IntelliJ IDEA and all the other plugins are or may be trademarks of their respective owners / creators. Please read the individual licenses for them.

docker-intellij's People

Contributors

bwplotka avatar dlsniper avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

docker-intellij's Issues

Doesn't work on my MAC

Command I use:
docker run -tdi --net="host" --privileged=true -e DISPLAY=${DISPLAY} -v /tmp/.X11-unix/:/tmp/.X11-unix -v ${HOME}/.IdeaIC2016.1_docker:/home/developer/.IdeaIC2016.1 -v ~/temp/go:/home/developer/go dlsniper/docker-intellij:idea2016.2

Output:
sudo: unable to resolve host moby: Connection timed out

Start Failed: Failed to initialize graphics environment

java.awt.AWTError: Can't connect to X11 window server using '/private/tmp/com.apple.launchd.bUt42OG3Yy/org.macosforge.xquartz:0' as the value of the DISPLAY variable.
at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
at sun.awt.X11GraphicsEnvironment.access$200(X11GraphicsEnvironment.java:65)
at sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:115)
at java.security.AccessController.doPrivileged(Native Method)
at sun.awt.X11GraphicsEnvironment.(X11GraphicsEnvironment.java:74)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at java.awt.GraphicsEnvironment.createGE(GraphicsEnvironment.java:103)
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:82)
at sun.awt.X11.XToolkit.(XToolkit.java:126)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at java.awt.Toolkit$2.run(Toolkit.java:860)
at java.awt.Toolkit$2.run(Toolkit.java:855)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:854)
at java.awt.Toolkit.getEventQueue(Toolkit.java:1734)
at java.awt.EventQueue.isDispatchThread(EventQueue.java:1043)
at javax.swing.SwingUtilities.isEventDispatchThread(SwingUtilities.java:1361)
at javax.swing.text.StyleContext.reclaim(StyleContext.java:454)
at javax.swing.text.StyleContext.addAttribute(StyleContext.java:311)
at javax.swing.text.html.StyleSheet.addAttribute(StyleSheet.java:578)
at javax.swing.text.StyleContext$NamedStyle.addAttribute(StyleContext.java:1501)
at javax.swing.text.StyleContext$NamedStyle.setName(StyleContext.java:1312)
at javax.swing.text.StyleContext$NamedStyle.(StyleContext.java:1259)
at javax.swing.text.StyleContext.addStyle(StyleContext.java:107)
at javax.swing.text.StyleContext.(StyleContext.java:87)
at javax.swing.text.html.StyleSheet.(StyleSheet.java:166)
at javax.swing.text.html.HTMLEditorKit.getStyleSheet(HTMLEditorKit.java:391)
at com.intellij.util.ui.UIUtil.(UIUtil.java:102)
at com.intellij.ide.plugins.PluginManager.start(PluginManager.java:72)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.ide.Bootstrap.main(Bootstrap.java:39)
at com.intellij.idea.Main.main(Main.java:101)

Improve readme

The readme should specify that the that --net="host" and -privileged=trueas pointed out by @Bplotka

Can't connect to X11 window server using ':0' as the value of the DISPLAY variable

I received the following error when running dlsniper/docker-intellij according to the readme:

$ docker run -ti \
           --net="host" \
           --privileged=true \
           -e DISPLAY=${DISPLAY} \
           -v /tmp/.X11-unix:/tmp/.X11-unix \
           -v ${HOME}/.IdeaIC2016.1_docker:/home/developer/.IdeaIC2016.1 \
           -v ${GOPATH}:/home/developer/go \
           dlsniper/docker-intellij

No protocol specified

Start Failed: Failed to initialize graphics environment

java.awt.AWTError: Can't connect to X11 window server using ':0' as the value of the DISPLAY variable.
	at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
	at sun.awt.X11GraphicsEnvironment.access$200(X11GraphicsEnvironment.java:65)
	at sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:115)
...

To resolve this, I ran sudo xhost + (note this method is very insecure, as it allows all incoming X connections).

setup my license in the container when starting

Hi, I have a personal license of intellij and I would like to set the license inside of the container ones and for all.
Either by rebuilding a new image and put the license at the right location. or has a volume at runtime.

Is this possible?
Thanks, awesome work!

The GUI is quite slow

Hello @dlsniper

have you found any ways how to speed up the GUI? The main menu, inline editing and the autocomplete are quite slow.

SSH tunneling with compression? Any special configuration?

Thanks a lot

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.