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-environment-metadata.md
+21-1Lines changed: 21 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,7 @@ folder: docs
9
9
10
10
Singularity containers have two level of metadata - environment variables, and labels from the user and bootstrap process.
11
11
12
+
12
13
### Environment
13
14
14
15
If you are importing a Docker container, the environment will be imported as well. If you want to define custom environment variables in your bootstrap recipe file `Singularity` you can do that like this
Your container stores metadata about it's build, along with Docker labels. You can see the data as follows:
62
+
Your container stores metadata about it's build, along with Docker labels, and your custom labels that you define in a bootstrap `%labels` section. For containers that are generated with Singularity version 2.4 and later, labels are represented using the <ahref="http://label-schema.org/rc1/">rc1 Label Schema</a>. For example:
You will notice that the one label doesn't belong to the label schema, `MAINTAINER`. This was a user provided label during bootstrap. For versions earlier than 2.4, containers did not use the label schema:
Copy file name to clipboardExpand all lines: pages/docs/user-docs/docs-inspect.md
+36-2Lines changed: 36 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ toc: false
6
6
folder: docs
7
7
---
8
8
9
-
How can you sniff an image? We have provided the inspect command for you to easily see the runscript, test script, environment, and metadata labels.
9
+
How can you sniff an image? We have provided the inspect command for you to easily see the runscript, test script, environment, help, and metadata labels.
10
10
11
11
{% include toc.html %}
12
12
@@ -27,6 +27,7 @@ INSPECT OPTIONS:
27
27
-t/--test Show the test script for this image
28
28
-e/--environment Show the environment settings for this container
29
29
-j/--json Print structured json instead of sections
30
+
-hf/--helpfile Inspect the runscript helpfile, if exists
and as outlined in the usage, you can specify to see any combination of `--labels`, `--environment`, `--runscript`, `--test`, and `--deffile`. The quick command to see everything, in json format, would be:
The commands `--helpfile` or `-hf` will show you the runscript helpfile, if it exists. With `--json` you can also see it as such:
166
+
167
+
```
168
+
singularity inspect -hf -j dino.img
169
+
{
170
+
"data": {
171
+
"attributes": {
172
+
"help": "\n\n\nHi there! This is my image help section.\n\nUsage:\n\nboobeep doo doo\n\n --arg/a arrrrg I'm a pirate!\n --boo/b eeeeeuzzz where is the honey?\n\n\n"
173
+
},
174
+
"type": "container"
175
+
}
176
+
}
177
+
```
178
+
179
+
or in a human friendly, readable print to the screen, don't use `-j` or `--json`:
180
+
181
+
```
182
+
$ singularity inspect -hf dino.img
183
+
184
+
185
+
Hi there! This is my image help section.
186
+
187
+
Usage:
188
+
189
+
boobeep doo doo
190
+
191
+
--arg/a arrrrg I'm a pirate!
192
+
--boo/b eeeeeuzzz where is the honey?
193
+
194
+
```
195
+
162
196
163
197
### Environment
164
198
The commands `--environment` and `-e` will show you the container's environment, again specified by the `%environment` section of a bootstrap file, and other `ENV` labels that might have come from a Docker import. You can again choose to see `--json`:
0 commit comments