You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pages/docs/user-docs/docs-bootstrap-image.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -125,7 +125,7 @@ The main content of the bootstrap file is broken into sections.
125
125
#### %setup
126
126
Setup is where you might perform actions on the host before we move into the container. For versions earlier than 2.3, or if you need files during `%post`, you should copy files from your host to `$SINGULARITY_ROOTFS` to move them into the container. For 2.3 and cases when you don't need the files until after `%post`, we recommend you use `%files`. We can see the difference between `%setup` and `%post` in the following asciicast:
127
127
128
-
{% include asciicast.html source='docs-bootstrap-setup-vs-post.json' title='How does the container see setup vs post?' author='vsochat@stanford.edu'%}
128
+
{% include asciicast.html source='docs-bootstrap-setup-vs-post.json' title='How the container sees setup vs post' author='vsochat@stanford.edu'%}
129
129
130
130
In the above, we see that copying something to `$SINGULARITY_ROOTFS` during `%setup` was successful to move the file into the container, but copying during `%post` was not.
Copy file name to clipboardExpand all lines: pages/docs/user-docs/docs-bootstrap.md
+14-6Lines changed: 14 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,12 +10,12 @@ The process of *bootstrapping* a Singularity container is equivalent to describi
10
10
11
11
{% include toc.html %}
12
12
13
-
## The header fields:
13
+
## The header:
14
14
15
15
### Bootstrap:
16
-
The `Bootstrap: ` keyword identifies the Singularity module that will be used for building the core components of the operating system. There are several supported modules at the time of this writing:
16
+
The `Bootstrap: ` keyword identifies the Singularity module that will be used for building the core components of the operating system. The module that you choose using `Bootstrap: ` defines the other keywords and values are needed/make sense in the header. There are several supported modules at the time of this writing:
17
17
18
-
#####**yum**
18
+
#### **yum**
19
19
20
20
The YUM bootstrap module uses YUM on the host system to bootstrap the core operating system that exists within the container. This module is applicable for bootstrapping distributions like Red Hat, Centos, and Scientific Linux. When using the `yum` bootstrap module, several other keywords may also be necessary to define:
21
21
@@ -25,24 +25,32 @@ The YUM bootstrap module uses YUM on the host system to bootstrap the core opera
25
25
26
26
Warning, there is a major limitation with using YUM to bootstrap a container and that is the RPM database that exists within the container will be created using the RPM library and Berkeley DB implementation that exists on the host system. If the RPM implementation inside the container is not compatible with the RPM database that was used to create the container, once the container has been created RPM and YUM commands inside the container may fail. This issue can be easily demonstrated by bootstrapping an older RHEL compatible image by a newer one (e.g. bootstrap a Centos 5 or 6 container from a Centos 7 host).
27
27
28
-
#####**debootstrap**
28
+
#### **debootstrap**
29
29
The Debian bootstrap module is a tool which is used specifically for bootstrapping distributions which utilize the `.deb` package format and `apt-get` repositories. This module will bootstrap any of the Debian and Ubuntu based distributions. When using the `debootstrap` module, the following keywords must also be defined:
30
30
31
31
-**MirrorURL**: This is the location where the packages will be downloaded from. When bootstrapping different Debian based distributions of Linux, this will define which varient will be used (e.g. specifying a different URL can be the difference between Debian or Ubuntu).
32
32
-**OSVersion**: This keyword must be defined as the alpha-character string associated with the version of the distribution you wish to use. For example, `trusty` or `stable`.
33
33
-**Include**: As with the `yum` module, the `Include` keyword will install additional packages into the core operating system and the best practice is to supply only the bare essentials such that the `%inside` scriptlet has what it needs to properly completely the bootstrap.
34
34
35
-
#####**arch**
35
+
#### **arch**
36
36
The Arch Linux bootstrap module does not name any additional keywords at this time. By defining the `arch` module, you have essentially given all of the information necessary for that particular bootstrap module to build a core operating system.
37
37
38
-
#####**docker**
38
+
#### **docker**
39
39
The Docker bootstrap module will create a core operating system image based on an image hosted on a particular Docker Registry server. By default it will use the primary Docker Library, but that can be overridden. When using the `docker` module, several other keywords may also be defined:
40
40
41
41
-**From**: This keyword defines the string of the registry name used for this image in the format [name]:[version]. Several examples are: `ubuntu:latest`, `centos:6`, `alpine:latest`, or `debian` (if the version tag is ommitted, `:latest` is automatically used).
42
42
-**IncludeCmd**: This keyword tells Singularity to utilize the Docker defined `Cmd` as the `%runscript` (defined below), if the `Cmd` is defined.
43
43
-**Registry**: If the registry you wish to download the image from is not from the main Docker Library, you can define it here.
44
44
-**Token**: Sometimes the Docker API (depending on version?) requires an authorization token which is generated on the fly. Toggle this with a `yes` or `no` here.
45
45
46
+
#### **localimage**
47
+
This module allows you to bootstrap a container from an existing Singularity image on your host system. You can use an existing container image as your "base" and then customize it with a new `%post``%environment`, `%runscript`, etc.
48
+
49
+
This module allows you to bootstrap a container from an existing Singularity image on your host system. You can use an existing container image as your "base," and then add customization. For example, you may have a different base image for several common operating systems, or for different versions of python, or for several different compilers. Instead of building these from scratch each time, you could start with the appropriate local base image and then customize the new image in `%post`, `%environment`, `%runscript`, etc.
50
+
51
+
When bootstrapping from a local image, all previous definition files that led to the creation of the current image will be stored in a directory within the container called `/.singularity.d/bootstrap_history`. Singularity will also alert you if environment variables have been changed between the base image and the new image during bootstrap.
52
+
53
+
-**From**: This keyword defines the path of the base image to bootstrap from. We recommend that you use absolute paths to point to your base image. In particular, substituting `~` for `/home/user` will likely fail or bootstrap from the wrong image because the bootstrap occurs as root.
46
54
47
55
## Bootstrap sections:
48
56
Once the `Bootstrap` module has completed, the sections are identified and utilized if present. The following sections are supported in the bootstrap definition, and integrated during the bootstrap process:
0 commit comments