Using Docker with cv2.imshow and Mac
- 17
- May
- Download and install Quartz. On newer Macs they no longer shipped with X11.
- Thanks to a user in the comments in this blog post I found this recipe
-
open -a XQuartz
ip=$(ifconfig en0 | grep inet | awk ‘$1==”inet” {print $2}’)
xhost + $ip
# container being used: dymat/opencv
docker run -it –rm -e DISPLAY=$ip:0 -v /tmp/.X11-unix:/tmp/.X11-unix -v $(PWD):/drs -v $(PWD)/photo-categorization/images:/images dymat/opencv python /drs/photo-categorization/main.py