@@ -17,7 +17,7 @@ complete known-good runtime for software and its dependencies. However,
17
17
containers are also purposefully isolated from the host system, so in
18
18
order to run a tool inside a Docker container there is additional work to
19
19
ensure that input files are available inside the container and output
20
- files can be recovered from the container. CWL can perform this work
20
+ files can be recovered from the container. A CWL runner can perform this work
21
21
automatically, allowing you to use Docker to simplify your software
22
22
management while avoiding the complexity of invoking and managing Docker
23
23
containers.
@@ -42,15 +42,31 @@ input object on the command line:
42
42
```
43
43
$ echo "console.log(\"Hello World\");" > hello.js
44
44
$ cwl-runner docker.cwl docker-job.yml
45
- [job 140259721854416] /home/example$ docker run -i --volume=/home/example/hello.js:/var/lib/cwl/job369354770_examples/hello.js:ro --volume=/home/example:/var/spool/cwl:rw --volume=/tmp/tmpDLs5hm:/tmp:rw --workdir=/var/spool/cwl --read-only=true --net=none --user=1001 --rm --env=TMPDIR=/tmp node:slim node /var/lib/cwl/job369354770_examples/hello.js
46
- Hello world!
45
+ [job docker.cwl] /tmp/tmpgugLND$ docker \
46
+ run \
47
+ -i \
48
+ --volume=/tmp/tmpgugLND:/var/spool/cwl:rw \
49
+ --volume=/tmp/tmpSs5JoN:/tmp:rw \
50
+ --volume=/home/me/cwl/user_guide/hello.js:/var/lib/cwl/stg16848d97-e6ba-4b35-b666-4546d9965a2d/hello.js:ro \
51
+ --workdir=/var/spool/cwl \
52
+ --read-only=true \
53
+ --user=1000 \
54
+ --rm \
55
+ --env=TMPDIR=/tmp \
56
+ --env=HOME=/var/spool/cwl \
57
+ node:slim \
58
+ node \
59
+ /var/lib/cwl/stg16848d97-e6ba-4b35-b666-4546d9965a2d/hello.js
60
+ Hello World
61
+ [job docker.cwl] completed success
62
+ {}
47
63
Final process status is success
48
64
```
49
65
50
66
Notice the CWL runner has constructed a Docker command line to run the
51
67
script. One of the responsibilities of the CWL runner is to adjust the paths of
52
68
input files to reflect the location where they appear inside the container.
53
- In this example, the path to the script ` hello.js ` is ` /home/example /hello.js `
69
+ In this example, the path to the script ` hello.js ` is ` /home/me/cwl/user_guide /hello.js `
54
70
outside the container but ` /var/lib/cwl/job369354770_examples/hello.js ` inside
55
71
the container, as reflected in the invocation of the ` node ` command.
56
72
0 commit comments