scidash / docker-stacks

Docker stacks for SciDash projects.
0 stars 0 forks source link

launch browser from inside a dockerimage easily achieved: HOWTO: #12

Closed russelljjarvis closed 7 years ago

russelljjarvis commented 7 years ago
USER root
RUN apt-get update
RUN apt-get install -y iceweasel gedit 
#iceweasal ~= firefox for debian, gedit is a reasonable graphical editor

For Ubuntu host:

This works very easily. launching: I have defined the alias in my ~/.bashrc: drh (Docker Run Here):

alias drh=' sudo docker run -it -e DISPLAY=$DISPLAY -v `pwd`:/home/mnt \
                                                    -v /tmp/.X11-unix:/tmp/.X11-unix \
                                                    deapscoop1 /bin/bash'

The alias probably should instead be function that is able to accept arguments also.

For Apple/MAC host

https://fredrikaverpil.github.io/2016/07/31/docker-for-mac-and-gui-applications/

This works because you are mounting the volume associated with your hosts.X11 server binary, and passing in your hosts environmental variable. I anticipate a future when the drh command will become very long.

The next step is to build this outside of and on-top of docker-stacks images using docker-compose, and also getting docker compose to fill out my github credentials.

rgerkin commented 7 years ago

@russelljjarvis What is the use case for this?

russelljjarvis commented 7 years ago

The use cases were: jupyter notebooks, atom, and graphical git merge using meld all from inside an interactive docker instance graphical git merge. Basically the idea was like having an entire linux OS as a docker container. This is not a part of my development cycle however.

rgerkin commented 7 years ago

I think all of those things can be done using tools from outside the container if the correct volumes and ports are mapped between host and container.