1singularity(1) singularity(1)
2
3
4
6 singularity-shell - Run a shell within a container
7
8
9
11 singularity shell [shell options...] <container>
12
13
14
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
41 ⟨https://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
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, for communicating with local docker registry
167
168
169 --nonet[=false]
170 Disable VM network handling
171
172
173 --nv[=false]
174 enable experimental Nvidia support
175
176
177 -o, --overlay=[]
178 use an overlayFS image for persistent data storage or as read-only
179 layer of container
180
181
182 --passphrase[=false]
183 Enter a passphrase for an encrypted contaner
184
185
186 --pem-path=""
187 Enter an path to a PEM formated RSA key for an encrypted container
188
189
190 -p, --pid[=false]
191 run container in a new PID namespace
192
193
194 --pwd=""
195 initial working directory for payload process inside the container
196
197
198 -S, --scratch=[]
199 include a scratch directory within the container that is linked to
200 a temporary dir (use -W to force location)
201
202
203 --security=[]
204 enable security features (SELinux, Apparmor, Seccomp)
205
206
207 -s, --shell=""
208 path to program to use for interactive shell
209
210
211 --syos[=false]
212 execute SyOS shell
213
214
215 -u, --userns[=false]
216 run container in a new user namespace, allowing Singularity to run
217 completely unprivileged on recent kernels. This disables some features
218 of Singularity, for example it only works with sandbox images.
219
220
221 --uts[=false]
222 run container in a new UTS namespace
223
224
225 --vm[=false]
226 enable VM support
227
228
229 --vm-cpu="1"
230 Number of CPU cores to allocate to Virtual Machine (implies --vm)
231
232
233 --vm-err[=false]
234 enable attaching stderr from VM
235
236
237 --vm-ip="dhcp"
238 IP Address to assign for container usage. Defaults to DHCP within
239 bridge network.
240
241
242 --vm-ram="1024"
243 Amount of RAM in MiB to allocate to Virtual Machine (implies --vm)
244
245
246 -W, --workdir=""
247 working directory to be used for /tmp, /var/tmp and $HOME (if
248 -c/--contain was also used)
249
250
251 -w, --writable[=false]
252 by default all Singularity containers are available as read only.
253 This option makes the file system accessible as read/write.
254
255
256 --writable-tmpfs[=false]
257 makes the file system accessible as read-write with non persistent
258 data (with overlay support only)
259
260
261
263 $ singularity shell /tmp/Debian.sif
264 Singularity/Debian.sif> pwd
265 /home/gmk/test
266 Singularity/Debian.sif> exit
267
268 $ singularity shell -C /tmp/Debian.sif
269 Singularity/Debian.sif> pwd
270 /home/gmk
271 Singularity/Debian.sif> ls -l
272 total 0
273 Singularity/Debian.sif> exit
274
275 $ sudo singularity shell -w /tmp/Debian.sif
276 $ sudo singularity shell --writable /tmp/Debian.sif
277
278 $ singularity shell instance://my_instance
279
280 $ singularity shell instance://my_instance
281 Singularity: Invoking an interactive shell within container...
282 Singularity container: > ps -ef
283 UID PID PPID C STIME TTY TIME CMD
284 ubuntu 1 0 0 20:00 ? 00:00:00 /usr/local/bin/singularity/bin/sinit
285 ubuntu 2 0 0 20:01 pts/8 00:00:00 /bin/bash --norc
286 ubuntu 3 2 0 20:02 pts/8 00:00:00 ps -ef
287
288
289
290
292 singularity(1)
293
294
295
297 21-Oct-2019 Auto generated by spf13/cobra
298
299
300
301Auto generated by spf13/cobra Oct 2019 singularity(1)