Wiki

Clone wiki

SAGE2 / Install (Docker)

Install Instructions for Docker (Windows, Mac OSX and Linux)

revision 2015-02-24

Install Docker

If you have Docker installed jump to "Install SAGE2". Follow the installation instructions for your operating system here

Test Docker

Now verify that the installation has worked by downloading the ubuntu image and launching a container.

#!shell
docker run -i -t ubuntu /bin/bash
Type
#!shell
exit
to exit

Install SAGE2

Get the latest SAGE2 image from dockerhub

#!shell
docker pull sage2/master
Install the data containers
#!shell
docker create -v /sage2/config --name sage2Config sage2/master
docker create -v /sage2/keys --name sage2Keys sage2/master
docker create -v /root/Documents/SAGE2_Media --name sage2Uploads sage2/master
Generate ssl keys, using your domain name as an argument to the below command. For example, if you are installing SAGE2 on sage2server.evl.uic.edu, then you need to pass it as _.evl.uic.edu Example:
#!shell
docker run --rm -it --volumes-from sage2Keys sage2/master /sage2/keys/GO-docker _.evl.uic.edu
Edit the configuration file
#!shell
docker run --rm -it --volumes-from sage2Config sage2/master /bin/bash
cd /sage2/config
vi docker-cfg.json
exit
Minimum configuration is setting the host (line 6).

Running SAGE2

First time you run SAGE2, you need to create a container that specifies how to run SAGE2. With the command below you create the container and run SAGE2.

#!shell
docker run -d --volumes-from=sage2Config --volumes-from=sage2Keys --volumes-from=sage2Uploads -p 9090:9090 -p 9292:9292 --name sage2 sage2/master
To see if it is running
#!shell
docker ps
To see the logs
#!shell
docker logs sage2
To stop sage2
#!shell
docker stop sage2
To start sage2 (Always use this command when starting SAGE2, unless this is the first time running!)
#!shell
docker start sage2

Setting the time

By default the timezone is set to Chicago time. To set the right timezone for your installation, you need to run the follow command while the container is running (For example setting it ot Arizona).

#!shell
docker exec -e "CONTAINER_TIMEZONE=US/Arizona" sage2 /sage2/bin/docker_set_timezone.sh
Full list of timezone codes, here. To find your area code, look under column TZ*.

NOTE: The above command is not persistent. Timezone will reset once you stop it. We suggest creating a startup script that first executes the run command (starting sage2 server) and then executes the exec command to set the right timezone.

Updating SAGE2
#!shell
docker pull sage2/master

Backing up and restoring your data

Backing up

You only need to backup your sage2Uploads data container.

#!shell
docker export --output="sage2Uploads.tar" sage2Uploads
More information about backing up data containers in docker here.

Restoring

#!shell
docker import sage2Uploads.tar
More information about restoring data containers in docker here.

Updated