@@ -81,41 +81,41 @@ See also `thebe.rst <thebe.rst>`_ for additional reader-oriented notes.
81
81
Extending the sagemath Docker image
82
82
-----------------------------------
83
83
84
- The sample [ `Dockerfile `]( https://github.com/sagemath/sage-binder-env/blob/master/Dockerfile)
85
- in this repository is based on the official `sagemath/sagemath ` Docker image. It includes
84
+ The sample `Dockerfile < https://github.com/sagemath/sage-binder-env/blob/master/Dockerfile >`_
85
+ in this repository is based on the official `` sagemath/sagemath ` ` Docker image. It includes
86
86
Sage itself, and all the software packages typically included in a standard Sage installation,
87
87
though not *everything * (in particular not optional Sage SPKGs, or other system software
88
88
packages).
89
89
90
- So in order to install additional Sage SPKGs it is possible to include a line like
90
+ So in order to install additional Sage SPKGs it is possible to include a line like::
91
91
92
92
RUN sage -i <spkg-name>
93
93
94
- in the `Dockerfile `. Note, due to a current shortcoming in the official Docker image it is
95
- also necessary to install the `make ` system package before running `sage -i `. See the
94
+ in the `` Dockerfile ` `. Note, due to a current shortcoming in the official Docker image it is
95
+ also necessary to install the `make ` system package before running `` sage -i ` `. See the
96
96
next section.
97
97
98
98
Installing additional system packages
99
99
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
100
100
101
101
To add additional software packages a couple more steps are involved,
102
- albeit relatively simple. The thing to understand about the `sagemath/sagemath ` image is
102
+ albeit relatively simple. The thing to understand about the `` sagemath/sagemath ` ` image is
103
103
that by default it puts you in a user called `sage `, so in order to install system packages
104
104
it is necessary, when extending the image, to first switch back to the `root ` user.
105
105
Then, because the image is based on Ubuntu, the `apt-get ` command can be used to install
106
106
Ubuntu packages. The canonical way to do this in a `Dockerfile ` involves updating the
107
107
APT cache, installing the packages, and then cleaning up the APT cache again all within
108
- a single command (this is in order to keep cache files out of the image):
108
+ a single command (this is in order to keep cache files out of the image)::
109
109
110
110
USER root
111
111
RUN apt-get -qq update \
112
112
&& apt-get -qq install -y --no-install-recommends <packages-to-install> \
113
113
&& apt-get -qq clean
114
114
USER sage
115
115
116
- Finally, just make sure toward the end of the `Dockerfile ` that you switch the image
117
- user back to `sage ` (so that when users run the container they are not running it as
118
- `root `.
116
+ Finally, just make sure toward the end of the `` Dockerfile ` ` that you switch the image
117
+ user back to `` sage ` ` (so that when users run the container they are not running it as
118
+ `` root ` `.
119
119
120
120
121
121
Authors
0 commit comments