Skip to content

Update 07-containers.md #143

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Aug 2, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion _episodes/07-containers.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ One of the responsibilities of the CWL runner is to adjust the paths of
input files to reflect the location where they appear inside the container.


This example runs a simple Node.js script inside a Docker container.
This example runs a simple Node.js script inside a Docker container which will
then print "Hello World" to the standard output.

*docker.cwl*

Expand All @@ -42,6 +43,27 @@ This example runs a simple Node.js script inside a Docker container.
~~~
{: .source}

Before we run this, lets just break it down and see what some bits do. Most of this
has been explained in previous sections, the only part that is really new is the `dockerRequirement`
section.

~~~
baseCommand: node
hints:
DockerRequirement:
dockerPull: node:slim
~~~

`baseCommand: node` tells CWL that we will be running this command in a container. We
then need to specify some `hints` for how to find the container we want. In this case we list
just our requirements for the docker container in `DockerRequirements`. The `dockerPull:`
parameter takes the same value that you would pass to a `docker pull` command. That is,
the name of the container image (you can even specify the tag, which is good idea for
best practises when using containers for reproducible research). In this case we have
used a container called `node:slime`.

{: .source}

Provide a "hello.js" and invoke `cwl-runner` providing the tool wrapper and the
input object on the command line:

Expand Down