sabri

sabri

Can't user :observer.start inside container

I run phoenix server into container at Mac, I run the container as:

docker run -p 4011:4011 -p 4033:4033 -v ~/.Xauthority:/root/.Xauthority -v /Users/samir/Documents/projects/elixir:/usr/src -e DISPLAY=$DISPLAY --network host -it elixir:1.5.2 bash

then, when I start phoenix as:

iex -S mix phx.server

I got error when try to run :observer.start:

iex(1)> :observer.start
13:50:45: Error: Unable to initialize GTK+, is DISPLAY set properly?
{:error,
{{:einval, ‘Could not initiate graphics’},
[{:wxe_server, :start, 1, [file: ‘wxe_server.erl’, line: 65]},
{:wx, :new, 1, [file: ‘wx.erl’, line: 115]},
{:observer_wx, :init, 1, [file: ‘observer_wx.erl’, line: 98]},
{:wx_object, :init_it, 6, [file: ‘wx_object.erl’, line: 372]},
{:proc_lib, :init_p_do_apply, 3, [file: ‘proc_lib.erl’, line: 247]}]}}

inside container:

$ echo $DISPLAY
/private/tmp/com.apple.launchd.xdi35OUtZR/org.macosforge.xquartz:0

Any idea?

Most Liked

StefanHoutzager

StefanHoutzager

I struggled with this also, and got the observer and other gui apps running. This is my solution: GitHub - StefanHoutzager/elixir-dev-anywhere-docker · GitHub

Qqwy

Qqwy

TypeCheck Core Team

What is it that you are trying to do? It is possible to connect to a remotely running Elixir or Erlang shell (or also one inside a container) from a local shell, and run :observer there, connecting the local graphical interface with the remote data. Maybe that is a possibility?

Another thing you might be able to do is to install a fake graphics driver in the container. But in that case, you cannot actually see observer yourself.

Where Next?

Popular in Questions Top

RisingFromAshes
I’ve read in another post that it may be possible with a router helper - but I couldn’t find an appropriate one, and tbh, I’m still just ...
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
Darmani72
If I have a post route which an argument: post /my_post_route/:my_param1, MyController.my_post_handler How would get the post params ...
New
9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New
dblack
I’ve got an issue with an app and I’ve no idea of how to troubleshoot it. I’m hoping someone here might have seen something similar. I p...
New
senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New

Other popular topics Top

Qqwy
Update: How to use the Blogs & Podcasts section You can post links to your blog posts or podcasts either in one of the Official Blog...
3271 131117 1222
New
vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
sergio
Kind of like when jquery came out, it was super necessary. Existing drag and drop libraries have a bunch of baggage to support old browse...
New

We're in Beta

About us Mission Statement