1singularity(1)                                                  singularity(1)
2
3
4

NAME

6       singularity-shell - Run a shell within a container
7
8
9

SYNOPSIS

11       singularity shell [shell options...] <container>
12
13
14

DESCRIPTION

16       singularity shell supports the following formats:
17
18
19       *.sif               Singularity Image Format (SIF). Native to
20       Singularity 3.0+
21
22
23       *.sqsh              SquashFS format.  Native to Singularity 2.4+
24
25
26       *.img               ext3 format. Native to Singularity versions < 2.4.
27
28
29       directory/          sandbox format. Directory containing a valid root
30       file
31                             system and optionally Singularity meta-data.
32
33
34       instance://*        A local running instance of a container. (See the
35       instance
36                             command group.)
37
38
39       library://*         A container hosted on a Library (default
40
41https://cloud.sylabs.io/library)⟩
42
43
44       docker://*          A container hosted on Docker Hub
45
46
47       shub://*            A container hosted on Singularity Hub
48
49
50       oras://*            A container hosted on a supporting OCI registry
51
52
53

OPTIONS

55       --add-caps=""
56           a comma separated capability list to add
57
58
59       --allow-setuid[=false]
60           allow setuid binaries in container (root only)
61
62
63       --app=""
64           set an application to run inside a container
65
66
67       --apply-cgroups=""
68           apply cgroups from file for container processes (root only)
69
70
71       -B, --bind=[]
72           a user-bind path specification.  spec has the format
73       src[:dest[:opts]], where src and dest are outside and inside paths.  If
74       dest is not given, it is set equal to src.  Mount options ('opts') may
75       be specified as 'ro' (read-only) or 'rw' (read/write, which is the
76       default). Multiple bind paths can be given by a comma separated list.
77
78
79       -e, --cleanenv[=false]
80           clean environment before running container
81
82
83       -c, --contain[=false]
84           use minimal /dev and empty other directories (e.g. /tmp and $HOME)
85       instead of sharing filesystems from your host
86
87
88       -C, --containall[=false]
89           contain not only file systems, but also PID, IPC, and environment
90
91
92       --disable-cache[=false]
93           dont use cache, and dont create cache
94
95
96       --dns=""
97           list of DNS server separated by commas to add in resolv.conf
98
99
100       --docker-login[=false]
101           login to a Docker Repository interactively
102
103
104       --drop-caps=""
105           a comma separated capability list to drop
106
107
108       -f, --fakeroot[=false]
109           run container in new user namespace as uid 0
110
111
112       -h, --help[=false]
113           help for shell
114
115
116       -H, --home="/builddir"
117           a home directory specification.  spec can either be a src path or
118       src:dest pair.  src is the source path of the home directory outside
119       the container and dest overrides the home directory within the
120       container.
121
122
123       --hostname=""
124           set container hostname
125
126
127       -i, --ipc[=false]
128           run container in a new IPC namespace
129
130
131       --keep-privs[=false]
132           let root user keep privileges in container (root only)
133
134
135       -n, --net[=false]
136           run container in a new network namespace (sets up a bridge network
137       interface by default)
138
139
140       --network="bridge"
141           specify desired network type separated by commas, each network will
142       bring up a dedicated interface inside container
143
144
145       --network-args=[]
146           specify network arguments to pass to CNI plugins
147
148
149       --no-home[=false]
150           do NOT mount users home directory if home is not the current
151       working directory
152
153
154       --no-init[=false]
155           do NOT start shim process with --pid
156
157
158       --no-nv[=false]
159
160
161       --no-privs[=false]
162           drop all privileges from root user in container)
163
164
165       --nohttps[=false]
166           do NOT use HTTPS with the docker:// transport (useful for local
167       docker registries without a certificate)
168
169
170       --nonet[=false]
171           disable VM network handling
172
173
174       --nv[=false]
175           enable experimental Nvidia support
176
177
178       -o, --overlay=[]
179           use an overlayFS image for persistent data storage or as read-only
180       layer of container
181
182
183       --passphrase[=false]
184           prompt for an encryption passphrase
185
186
187       --pem-path=""
188           enter an path to a PEM formated RSA key for an encrypted container
189
190
191       -p, --pid[=false]
192           run container in a new PID namespace
193
194
195       --pwd=""
196           initial working directory for payload process inside the container
197
198
199       --rocm[=false]
200           enable experimental Rocm support
201
202
203       -S, --scratch=[]
204           include a scratch directory within the container that is linked to
205       a temporary dir (use -W to force location)
206
207
208       --security=[]
209           enable security features (SELinux, Apparmor, Seccomp)
210
211
212       -s, --shell=""
213           path to program to use for interactive shell
214
215
216       --syos[=false]
217           execute SyOS shell
218
219
220       -u, --userns[=false]
221           run container in a new user namespace, allowing Singularity to run
222       completely unprivileged on recent kernels. This disables some features
223       of Singularity, for example it only works with sandbox images.
224
225
226       --uts[=false]
227           run container in a new UTS namespace
228
229
230       --vm[=false]
231           enable VM support
232
233
234       --vm-cpu="1"
235           number of CPU cores to allocate to Virtual Machine (implies --vm)
236
237
238       --vm-err[=false]
239           enable attaching stderr from VM
240
241
242       --vm-ip="dhcp"
243           IP Address to assign for container usage. Defaults to DHCP within
244       bridge network.
245
246
247       --vm-ram="1024"
248           amount of RAM in MiB to allocate to Virtual Machine (implies --vm)
249
250
251       -W, --workdir=""
252           working directory to be used for /tmp, /var/tmp and $HOME (if
253       -c/--contain was also used)
254
255
256       -w, --writable[=false]
257           by default all Singularity containers are available as read only.
258       This option makes the file system accessible as read/write.
259
260
261       --writable-tmpfs[=false]
262           makes the file system accessible as read-write with non persistent
263       data (with overlay support only)
264
265
266

EXAMPLE

268                $ singularity shell /tmp/Debian.sif
269                Singularity/Debian.sif> pwd
270                /home/gmk/test
271                Singularity/Debian.sif> exit
272
273                $ singularity shell -C /tmp/Debian.sif
274                Singularity/Debian.sif> pwd
275                /home/gmk
276                Singularity/Debian.sif> ls -l
277                total 0
278                Singularity/Debian.sif> exit
279
280                $ sudo singularity shell -w /tmp/Debian.sif
281                $ sudo singularity shell --writable /tmp/Debian.sif
282
283                $ singularity shell instance://my_instance
284
285                $ singularity shell instance://my_instance
286                Singularity: Invoking an interactive shell within container...
287                Singularity container: > ps -ef
288                UID        PID  PPID  C STIME TTY          TIME CMD
289                ubuntu       1     0  0 20:00 ?        00:00:00 /usr/local/bin/singularity/bin/sinit
290                ubuntu       2     0  0 20:01 pts/8    00:00:00 /bin/bash --norc
291                ubuntu       3     2  0 20:02 pts/8    00:00:00 ps -ef
292
293
294
295

SEE ALSO

297       singularity(1)
298
299
300

HISTORY

302       18-Feb-2020 Auto generated by spf13/cobra
303
304
305
306Auto generated by spf13/cobra      Feb 2020                     singularity(1)
Impressum