dlsniper / docker-intellij

Docker image for IntelliJ IDEA Community, Go and Go plugin
MIT License
29 stars 22 forks source link

Doesn't work on my MAC #5

Open jjzhangg opened 8 years ago

jjzhangg commented 8 years ago

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)

dlsniper commented 8 years ago

Hi,

Sorry, I've forgot to get back on this. I don't have a Mac so I can't test this, any help is welcomed. Thank you.

allamand commented 8 years ago

@jjzhangg I had a similar error (DISPLAY connextion error) and I have workarround this using root user and mounting my .Xauthority file :

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

I don't know why without the -u root the sudo won't works, but with it it works..