Docker (deprecated): Difference between revisions

From AG Euler Wiki
Jump to navigation Jump to search
Line 5: Line 5:
==What do we use docker for?==
==What do we use docker for?==


The Euler group is currently using docker to host [[Jupyter_Notebooks|our two Jupyter notebook servers]], though in the past we have also used it for hosting a MySQL server. To see what containers are currently running, ssh into 'cn31' and enter the command <blockquote>docker ps</blockquote>. This will return a list of the currently active
The Euler group is currently using docker to host [[Jupyter_Notebooks|our two Jupyter notebook servers]], though in the past we have also used it for hosting a MySQL server. To see what containers are currently running, ssh into 'cn31' and enter the command <blockquote>docker ps</blockquote> This will return a list of the currently active docker containers, the images they are built from, how long they have been online and what ports they are forwarded to.
 
New docker containers can be built using the command <blockquote>docker run [...]</blockquote> For example, to build a new scipyserver called 'miranda', forwarded to port 1948 on localhost with the password 'uranus', you would enter <blockquote>docker run -d -p 1948:8888 --name miranda -e "PASSWORD=uranus" -e DISPLAY=$DISPLAY</blockquote>. Each of the -tags has a unique function in building the server.
 
{|
|Tag
|Function
|-
|-d
|Run in the background
|-
|-p 1948:8888
|Forward port 8888 to 1948
|-
|--name
|Specify server name
|-
|-e "PASSWORD=[...]"
|Set password
|-
|-e DISPLAY=$DISPLAY
|Needed for plotting in Jupyter
|-
|--help
|Show different tag options for given command
|}

Revision as of 10:17, 13 October 2015

What is docker?

Docker is a platform for running virtual machines called containers. These are functionally analogous to the operating systems on a computer, though you can run them from within your operating system. They are useful because they create lightweight, customisable environments within which you can run software. This is particularly helpful when you have programs which have very particular dependencies, or require a linux base installation in order to function correctly. You can read more about docker here.

What do we use docker for?

The Euler group is currently using docker to host our two Jupyter notebook servers, though in the past we have also used it for hosting a MySQL server. To see what containers are currently running, ssh into 'cn31' and enter the command

docker ps

This will return a list of the currently active docker containers, the images they are built from, how long they have been online and what ports they are forwarded to. New docker containers can be built using the command

docker run [...]

For example, to build a new scipyserver called 'miranda', forwarded to port 1948 on localhost with the password 'uranus', you would enter

docker run -d -p 1948:8888 --name miranda -e "PASSWORD=uranus" -e DISPLAY=$DISPLAY

. Each of the -tags has a unique function in building the server.

Tag Function
Run in the background
Forward port 8888 to 1948
Specify server name
Set password
Needed for plotting in Jupyter
Show different tag options for given command