Skip to content

fjebaker/sagemath-resources

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 

Repository files navigation

sagemath-resources

Resources I'm using to teach / introduce SageMath. Additionally resources I use to teach myself.

Docker

The official SageMath Docker images require differentiation between py and py3; in general, prefer the command

docker pull sagemath/sagemath:latest-py3

to get the Python3 version of SageMath (I'm unsure if the tag latest still maps to py2?). Another point to note is SageMath is now on relase 9.2, however the docker images only have 9.2 listed as a beta release, with no RC. Consequently, I have updated my machine to use 9.3.beta6-py3, as to have access to later features and bugfixes.

The default working directory of the sagemath docker image is

/home/sage

A handly little shell script to use is then:

#!/bin/bash

WORKING_DIR=${NOTEBOOK_DIR:-~/Documents/SageMath}

echo "Using working directory local:$WORKING_DIR"

docker run --rm -p 8888:8888 -v $WORKING_DIR:/home/sage/notebooks --name sagemath sagemath/sagemath:latest-py3 sage-jupyter

Which will default the persitent notebook directory to your Documents folder, and init a jupyter kernel for you.

Any notebooks created in ~/notebooks on the filesystem of the docker image will then be saved on the host machine.