This repository contains the base Dockerfiles used for compiling and running SaC programs.
Pre-built Docker images are available on DockerHub.
For first time users of SaC we recommend using the Jupyter Notebook environment.
Pull the most recent image with:
docker pull sacbase/sac-jupyter-notebookAnd start the Jupyter notebook using:
docker run --rm -p 8888:8888 sacbase/sac-jupyter-notebookTo access an existing notebook on your system, you can use a bind mount. Open a terminal and change directory to where your existing notebook is. Then, run the following command:
docker run --rm -p 8888:8888 -v "$(pwd):/home/jovyan/work" sacbase/sac-jupyter-notebookThe -v option tells Docker to mount your current working directory to /home/jovyan/work inside the container.
By default, the Jupyter image's root directory is /home/jovyan and you can only access or save notebooks to that directory in the container.
After the container has started multiple URLs will be printed; use the one starting with 127.0.0.1:8888.
For compiling SaC programs we recommend the sac-compiler Docker container.
Using this container with Visual Studio Code requires the Dev Containers extension.
Check the documentation for a comprehensive tutorial.
In short: first add the following .devcontainer.json file to your local development directory
{
"image": "sacbase/sac-compiler",
"runArgs": [
"--user", "1000:1000"
]
}1000:1000 is the default for most first non-root users, but otherwise get your values with id -u and id -g.
In VS Code run the Dev Containers: Open Folder in Container... command from the Command Palette (F1).
You have now opened your local development directory within the SaC Docker container, with full access to the sac2c compiler and standard library.
Happy developing!