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

EXAMPLE

260                $ singularity exec /tmp/debian.sif cat /etc/debian_version
261                $ singularity exec /tmp/debian.sif python ./hello_world.py
262                $ cat hello_world.py | singularity exec /tmp/debian.sif python
263                $ sudo singularity exec --writable /tmp/debian.sif apt-get update
264                $ singularity exec instance://my_instance ps -ef
265                $ singularity exec library://centos cat /etc/os-release
266
267
268
269

SEE ALSO

271       singularity(1)
272
273
274

HISTORY

276       18-Feb-2020 Auto generated by spf13/cobra
277
278
279
280Auto generated by spf13/cobra      Feb 2020                     singularity(1)
Impressum