bcgsc / orca

:whale: Genomics Research Container Architecture
http://www.bcgsc.ca/services/orca
GNU General Public License v3.0
48 stars 13 forks source link

Run GUI apps in a container #29

Closed tmozgach closed 6 years ago

tmozgach commented 6 years ago

Example: igv Dockerfile:

FROM linuxbrew/linuxbrew
ENV PERL5LIB /home/linuxbrew/perl5/lib/perl5
RUN sudo apt-get update && sudo apt-get install -y \
    software-properties-common \
    default-jre \
    wget \
    unzip \
    glib-networking-common
RUN brew tap homebrew/science
RUN brew install igv
USER 1992 

How do I run graphical programs remotely from a Linux server for different OS: https://uisapp2.iu.edu/confluence-prd/pages/viewpage.action?pageId=280461906

tmozgach commented 6 years ago

For MAC: Steps: *Open new terminal in Xquartz

ssh -AY docker02.bcgsc.ca

*The following block we should put in the file that runs during the authorization: But now, I just type them in the command line:

SESSIONXAUTH=${XAUTHORITY:-$HOME/.Xauthority}
DOCKER_XAUTH=${SESSIONXAUTH}.docker
cp --preserve=all $SESSIONXAUTH $DOCKER_XAUTH
USER=$(id –un)

*Run the container:

docker run -it -v /tmp/.X11-unix:/tmp/.X11-unix -v $DOCKER_XAUTH:$DOCKER_XAUTH:ro -e XAUTHORITY=$DOCKER_XAUTH -e DISPLAY=$DISPLAY -u $(id -u):$(id -g) -w /home/$USER -v $HOME:/home/$USER --net host --name igv36 igv

*try igv

igv

*Open new terminal in Xquartz

ssh -AY docker02.bcgsc.ca
SESSIONXAUTH=${XAUTHORITY:-$HOME/.Xauthority}
DOCKER_XAUTH=${SESSIONXAUTH}.docker
cp --preserve=all $SESSIONXAUTH $DOCKER_XAUTH
USER=$(id –un)

*Run that container again

docker exec -it -u $(id -u):$(id -g) igv36 /bin/bash -c "export DISPLAY=${DISPLAY} && /bin/bash”

*try igv second terminal

igv

*Close the first terminal

*try again igv in the second terminal

igv
tmozgach commented 6 years ago

@sjackman Could you please look at it and think about possible insecure situations if you are familiar with that topic?

sjackman commented 6 years ago

Please enclose shell commands in triple back ticks. See https://help.github.com/articles/basic-writing-and-formatting-syntax/#quoting-code

sjackman commented 6 years ago

Thanks for the instructions to reproduce the issue, Tanya.

tmozgach commented 6 years ago

For linux: In the terminal:

ssh -AY docker02.bcgsc.ca

Perform all above steps (For Mac).

tmozgach commented 6 years ago

For Windows: Run Xming Run Putty:

Log in using your normal IU username and passphrase Perform all above steps (For Mac).

tmozgach commented 6 years ago

Works!