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
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
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.
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex









