Skip to content

Commit

Permalink
Have fixed DISPLAY conflict issues
Browse files Browse the repository at this point in the history
  • Loading branch information
yyan7223 committed Sep 23, 2024
1 parent 830d0f7 commit bb8e18e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 21 deletions.
15 changes: 3 additions & 12 deletions run_docker.sh
Original file line number Diff line number Diff line change
@@ -1,24 +1,15 @@
#!/usr/bin/env bash

IMAGE=cgra/cgra-flow:demo
COMMAND=/bin/bash
NIC=$(sudo cat /proc/net/dev | awk 'END {print $1}' | sed 's/^[\t]*//g' | sed 's/[:]*$//g')

# Grab the ip address of this box
IPADDR=$(ifconfig $NIC | grep "inet " | awk '{print $2}')

DISP_NUM=100 # fixed display number to 100

PORT_NUM=$((6000 + DISP_NUM))

socat TCP-LISTEN:${PORT_NUM},reuseaddr,fork UNIX-CLIENT:/tmp/.X11-unix/X0 2>&1 > /dev/null &
CONTAINER=CGRA-Flow-OpenRoad

This comment has been minimized.

Copy link
@tancheng

tancheng Sep 24, 2024

Owner

Hmmm, why we use this one? Where is the docker from?


XSOCK=/tmp/.X11-unix

sudo docker run \
-it \
--name=CGRA-Flow \
--name=$CONTAINER \
-v $XSOCK:$XSOCK:rw \
-e DISPLAY=$IPADDR:$DISP_NUM \
-e DISPLAY=unix$DISPLAY \
$IMAGE

11 changes: 2 additions & 9 deletions start_docker.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
#!/usr/bin/env bash

CONTAINER=CGRA-Flow
COMMAND=/bin/bash
CONTAINER=CGRA-Flow-OpenRoad

DISP_NUM=100 # fixed display number to 100

PORT_NUM=$((6000 + DISP_NUM))

socat TCP-LISTEN:${PORT_NUM},reuseaddr,fork UNIX-CLIENT:/tmp/.X11-unix/X0 2>&1 > /dev/null &

XSOCK=/tmp/.X11-unix
xhost +

sudo docker start -i $CONTAINER

0 comments on commit bb8e18e

Please sign in to comment.