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

NAME

6       singularity-exec - Run a command within a container
7
8
9

SYNOPSIS

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

DESCRIPTION

16       singularity exec 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 exec
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       -u, --userns[=false]
208           run container in a new user namespace, allowing Singularity to run
209       completely unprivileged on recent kernels. This disables some features
210       of Singularity, for example it only works with sandbox images.
211
212
213       --uts[=false]
214           run container in a new UTS namespace
215
216
217       --vm[=false]
218           enable VM support
219
220
221       --vm-cpu="1"
222           Number of CPU cores to allocate to Virtual Machine (implies --vm)
223
224
225       --vm-err[=false]
226           enable attaching stderr from VM
227
228
229       --vm-ip="dhcp"
230           IP Address to assign for container usage. Defaults to DHCP within
231       bridge network.
232
233
234       --vm-ram="1024"
235           Amount of RAM in MiB to allocate to Virtual Machine (implies --vm)
236
237
238       -W, --workdir=""
239           working directory to be used for /tmp, /var/tmp and $HOME (if
240       -c/--contain was also used)
241
242
243       -w, --writable[=false]
244           by default all Singularity containers are available as read only.
245       This option makes the file system accessible as read/write.
246
247
248       --writable-tmpfs[=false]
249           makes the file system accessible as read-write with non persistent
250       data (with overlay support only)
251
252
253

EXAMPLE

255                $ singularity exec /tmp/debian.sif cat /etc/debian_version
256                $ singularity exec /tmp/debian.sif python ./hello_world.py
257                $ cat hello_world.py | singularity exec /tmp/debian.sif python
258                $ sudo singularity exec --writable /tmp/debian.sif apt-get update
259                $ singularity exec instance://my_instance ps -ef
260                $ singularity exec library://centos cat /etc/os-release
261
262
263
264

SEE ALSO

266       singularity(1)
267
268
269

HISTORY

271       21-Oct-2019 Auto generated by spf13/cobra
272
273
274
275Auto generated by spf13/cobra      Oct 2019                     singularity(1)
Impressum