ksylvan / docker-pgmodeler

pgmodeler in a container
33 stars 13 forks source link

Running on Mac OS X(mojave 10.14.5) #4

Open haisamido opened 5 years ago

haisamido commented 5 years ago

I followed these steps on my mac os x laptop https://github.com/ksylvan/docker-pgmodeler#macos-using-this-image and I get this error:

2019/07/31 14:37:48 socat[48432] E bind(5, {LEN=0 AF=2 0.0.0.0:6001}, 16): Address already in use
Unsupported screen format: depth: 8, red_mask: 0, blue_mask: 0
Unsupported screen format: depth: 8, red_mask: 0, blue_mask: 0
Unsupported screen format: depth: 8, red_mask: 0, blue_mask: 0
Unsupported screen format: depth: 8, red_mask: 0, blue_mask: 0
Segmentation fault
[2]+  Exit 1                  socat TCP-LISTEN:6001,reuseaddr,fork UNIX-CLIENT:\"$DISPLAY\"

Not sure why this is happening.

haisamido commented 5 years ago

BTW, I tested this on High Sierra (10.13.6) and it worked, so this may be a problem with Mojave (10.14.5)

ksylvan commented 5 years ago

Looks like for some reason, port 6001 is already being used?

ksylvan commented 5 years ago

Try setting DISPLAY to ":2" and use 6002 and see if that works?

haisamido commented 5 years ago

I created this Makefile, and ran the image differently and I succeeded!

.PHONY: pgmodeler build color-depth x11

# Install brew if you don't have it
brew:
    @command -v brew || /usr/bin/ruby -e "$$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

# Install X11/Xquartz if you don't have it
x11: brew
    brew cask list xquartz || brew cask install xquartz
    open /Applications/Utilities/XQuartz.app

xquartz: x11

color-depth: x11
    defaults write org.macosforge.xquartz.X11 depth -int 32

# Source: 
#   https://hub.docker.com/r/kayvan/pgmodeler/
#   https://github.com/ksylvan/docker-pgmodeler
build:
    docker pull kayvan/pgmodeler

pgmodeler: build color-depth x11
    docker run -ti --rm \
        -e DISPLAY=host.docker.internal:0 \
        kayvan/pgmodeler

I can do a pull-request to add this to your repo. note that I ran pgmodeler this way

docker run -ti --rm -e DISPLAY=host.docker.internal:0 kayvan/pgmodeler

socat is not needed?

ksylvan commented 5 years ago

Yes, please! Thank you!

ksylvan commented 5 years ago

I can do a pull-request to add this to your repo. note that I ran pgmodeler this way

Please send a pull request for the README. Thanks.