@@ -93,9 +93,8 @@ If you need a finer control over the container execution, or you feel comfortabl
93
93
94
94
### Accessing filesystems in the host within the container
95
95
96
- Containers are confined in a sandbox, so they can't access the host
97
- in any ways unless you explicitly prescribe acceptable accesses
98
- to the host.
96
+ Containers are confined in a sandbox, so they can't access the data on the host
97
+ unless explicitly enabled.
99
98
The Docker Engine provides mounting filesystems into the container with the ` -v ` argument and the following syntax:
100
99
` -v some/path/in/host:/absolute/path/within/container:ro ` ,
101
100
where the trailing ` :ro ` specifies that the mount is read-only.
@@ -121,9 +120,10 @@ $ docker run -ti --rm \
121
120
participant
122
121
```
123
122
124
- When ** debugging** or ** reusing pre-cached intermediate results** ,
125
- you'll also need to mount some working directory that otherwise
126
- is not exposed by the application.
123
+ We recommend mounting a work (or scratch) directory for intermediate workflow results.
124
+ This is particularly useful for ** debugging** or ** reusing pre-cached intermediate results** ,
125
+ but can also be useful to control where these (large) directories get created,
126
+ as the default location for files created inside a docker container may not have sufficient space.
127
127
In the case of * NiPreps* , we typically inform the * BIDS Apps*
128
128
to override the work directory by setting the ` -w ` /` --work-dir `
129
129
argument (please note that this is not defined by the * BIDS Apps*
@@ -155,12 +155,10 @@ $ docker run -ti --rm \
155
155
156
156
``` {.shell hl_lines="4 5 9"}
157
157
$ docker run -ti --rm \
158
- -v path/to/data:/data:ro \
159
- -v path/to/output:/out \
160
- -v $PWD:$PWD \
161
- -w $PWD \ # DO NOT confuse with the application's work directory
158
+ -v $PWD:$PWD \ # Mount the current directory with its own name
159
+ -w $PWD \ # DO NOT confuse with the application's work directory
162
160
nipreps/fmriprep:<latest-version> \
163
- / data /out/out \
161
+ inputs/raw- data outputs/fmriprep \ # With YODA, the inputs are inside the working directory
164
162
participant
165
163
-w $PWD/work
166
164
```
@@ -185,7 +183,7 @@ $ docker run -ti --rm \
185
183
for atlases and templates management may require
186
184
the * TemplateFlow Archive* be mounted from the host.
187
185
Mounting the * Archive* from the host is an effective way
188
- to preempt the download of your favorite templates in every run :
186
+ to prevent multiple downloads of templates that are not bundled in the image :
189
187
190
188
``` {.shell hl_lines="5 6"}
191
189
$ docker run -ti --rm \
@@ -226,21 +224,21 @@ account in *Linux*.
226
224
In other words, by default * Docker* will use the superuser account
227
225
to execute the container and will write files with the corresponding
228
226
uid=0 unless configured otherwise.
229
- Executing as superuser may derive in permissions and security issues,
227
+ Executing as superuser may result in permissions and security issues,
230
228
for example, [ with * DataLad* (discussed later)] ( datalad.md# ) .
231
229
One paramount example of permissions issues where beginners typically
232
230
run into is deleting files after a containerized execution.
233
231
If the uid is not overridden, the outputs of a containerized execution
234
232
will be owned by ** root** and group ** root** .
235
233
Therefore, normal users will not be able to modify the output and
236
- superuser permissions will be required to deleted data generated
234
+ superuser permissions will be required to delete data generated
237
235
by the containerized application.
238
236
Some shared systems only allow running containers as a normal user
239
- because the user will not be able to action on the outputs otherwise.
237
+ because the user will not be able to operate on the outputs otherwise.
240
238
241
- Either way (whether the container is available with default settings
242
- or the execution has been customized to normal users) ,
243
- running as a normal user allows preempting these permissions issues.
239
+ Whether the container is available with default settings,
240
+ or the execution has been customized to normal users,
241
+ running as a normal user avoids these permissions issues.
244
242
This can be achieved with
245
243
[ * Docker* 's ` -u ` /` --user ` option] ( https://docs.docker.com/engine/containers/run/#user ) :
246
244
@@ -286,8 +284,8 @@ command line follows the interface defined by the specific
286
284
[ * fMRIPrep* ] ( https://fmriprep.readthedocs.io/en/latest/usage.html )
287
285
or [ * MRIQC* ] ( https://mriqc.readthedocs.io/en/latest/running.html#command-line-interface ) ).
288
286
289
- The first section of a call comprehends arguments specific to * Docker* ,
290
- and configure the execution of the container:
287
+ The first section of a call consists of arguments specific to * Docker* ,
288
+ which configure the execution of the container:
291
289
292
290
``` {.shell hl_lines="1-7"}
293
291
$ docker run -ti --rm \
0 commit comments