Difference between revisions of "Docker install"

From relax wiki
Jump to navigation Jump to search
Line 4: Line 4:
 
* https://cloud.docker.com/swarm/tlinnet/repository/docker/tlinnet/relax/general
 
* https://cloud.docker.com/swarm/tlinnet/repository/docker/tlinnet/relax/general
  
To get  
+
To get image
 
<source lang=bash>
 
<source lang=bash>
 +
docker pull tlinnet/relax
 +
</source>
 +
 +
See images
 +
<source lang=bash>
 +
docker images
 +
</source>
 +
 +
== Run the image on mac ==
 +
On mac, first make sure XQuartz is running
 +
<source lang=bash>
 +
open -a XQuartz
 +
# In XQuartz -> Preferences > Security, make sure the tick "Allow connections from network clients" is ON.
 +
</source>
 +
 +
Then set DISPLAY options. Verifu
 +
<source lang=bash>
 +
# Its either of these. Check which one return IP addr.
 +
ipconfig getifaddr en1
 +
ipconfig getifaddr en0
 +
 +
# Run appropriate
 +
xhost + `ipconfig getifaddr en1`
 +
xhost + `ipconfig getifaddr en0`
 +
</source>
 +
 +
Then make alias and run
 +
<source lang=bash>
 +
alias dr='docker run -ti --rm -e DISPLAY=$(ipconfig getifaddr en1):0 -v /tmp/.X11-unix:/tmp/.X11-unix -v $PWD:/home/developer/work --name ubuntu_relax relax'
 +
 +
# Start relax
 +
dr relax
 +
 +
# Start relax in GUI
 +
dr relax -g
 +
 +
# Start OpenDX
 +
dr dx
 +
 +
# Try OpenMPI
 +
dr mpirun --version
 +
dr mpirun -np 2 echo "hello world"
 +
dr mpirun --report-bindings -np 2 echo "hello world"
 +
</source>
 +
 +
To make this easier, consider adding this to HOME/.bash_profile
 +
<source lang=bash>
 +
# Start docker, if it is not running
 +
alias drdocker='open -a /Applications/Docker.app/Contents/MacOS/Docker'
 +
# Start  XQuartz, if it is not running
 +
alias drx='open -a XQuartz; xhost + `ipconfig getifaddr en1`'
 +
# Alias the docker run command
 +
alias dr='docker run -ti --rm -e DISPLAY=$(ipconfig getifaddr en1):0 -v /tmp/.X11-unix:/tmp/.X11-unix -v $PWD:/home/developer/work --name ubuntu_relax relax'
 
</source>
 
</source>
  
 
== See also ==
 
== See also ==
 
[[Category:Installation]]
 
[[Category:Installation]]

Revision as of 12:31, 25 October 2017

Dockerfile

The Dockerfile for the build can be seen here:

To get image

docker pull tlinnet/relax

See images

docker images

Run the image on mac

On mac, first make sure XQuartz is running

open -a XQuartz
# In XQuartz -> Preferences > Security, make sure the tick "Allow connections from network clients" is ON.

Then set DISPLAY options. Verifu

# Its either of these. Check which one return IP addr.
ipconfig getifaddr en1
ipconfig getifaddr en0

# Run appropriate
xhost + `ipconfig getifaddr en1`
xhost + `ipconfig getifaddr en0`

Then make alias and run

alias dr='docker run -ti --rm -e DISPLAY=$(ipconfig getifaddr en1):0 -v /tmp/.X11-unix:/tmp/.X11-unix -v $PWD:/home/developer/work --name ubuntu_relax relax'

# Start relax
dr relax

# Start relax in GUI
dr relax -g

# Start OpenDX
dr dx

# Try OpenMPI
dr mpirun --version
dr mpirun -np 2 echo "hello world"
dr mpirun --report-bindings -np 2 echo "hello world"

To make this easier, consider adding this to HOME/.bash_profile

# Start docker, if it is not running
alias drdocker='open -a /Applications/Docker.app/Contents/MacOS/Docker'
# Start  XQuartz, if it is not running
alias drx='open -a XQuartz; xhost + `ipconfig getifaddr en1`'
# Alias the docker run command
alias dr='docker run -ti --rm -e DISPLAY=$(ipconfig getifaddr en1):0 -v /tmp/.X11-unix:/tmp/.X11-unix -v $PWD:/home/developer/work --name ubuntu_relax relax'

See also