<p><strong>EDIT Summary</strong></p>
<p>For future users who encounter the problem the solution is,</p>
<pre><code>docker run --platform linux/amd64 --rm -it -u 0 --entrypoint /bin/sh  nvcr.io/nvidia/clara/clara-parabricks:4.0.1-1
</code></pre>
<p>I am unhappy with the practice of limiting Docker access via blocking standard runtime: there are statements of intent on SE as a strategy to attempt to restrict Docker access. Parabricks isn't an isolated incident of deploying this setup within bioinformatics. However, I checked their <a href="https://forums.developer.nvidia.com/t/how-parabricks-hide-docker-container-content/192104" rel="nofollow noreferrer">forum</a> and there is no statement of intent that it's deliberate. Parabrick's copyrights are <a href="https://docs.nvidia.com/clara/parabricks/3.7.0/Documentation/ThirdPartySoftwareNotices.html" rel="nofollow noreferrer">here</a>. There would be issues if there was ever an official statement to this extent. They would likely argue it was for other reasons to automate stuff.</p>
<hr />
<p><em>Original answer</em> ...</p>
<p>I don't know parabricks, but I know Docker. What you are attempting is to run Docker from the outside ... I would get on the inside to view the error log. Whats happening is the error is not being passed outside the container. Getting on the inside requires</p>
<pre><code>docker run  --rm -it --name mydocker nvcr.io/nvidia/clara/clara-parabricks:4.0.1-1
</code></pre>
<p>This <em>should</em> give you access to the container. If it doesn't post back and I'll forward a different command that will. It's impossible to block access to a Docker container albeit some people try.</p>
<p>For simplicity is worth trying</p>
<pre><code>docker run  --rm -it --name mydocker clara-parabricks:4.0.1-1
</code></pre>
<p>Anyway, if you are using this approach you'll need,</p>
<pre><code>docker cp *outside container* *insider container* nvcr.io/nvidia/clara/clara-parabricks:4.0.1-1 and vice versa
</code></pre>
<p>... this is an amazing command and allows you to move data in and out of the container. You've got to get the data on the inside of the docker and <code>docker cp</code> does that very well. I would then look to running the whole thing from the inside of the container. Thats exactly how I run Dockers, then I exit and return when it's done. There might be a bit of clean via this approach, I'm not sure <code>--rm</code> might take care of it.</p>
<p>You'll also be able to look at the programs and copy it out onto hard drive. This last bit may be not advisable - the whole point of Docker is to protect your system from their algorithms ... but you can definitely do it and if you get it paired up with NextFlow thats cool.</p>
<p>I don't particularly want to pull the Docker container because they're often huge and I've no interest in the algorithm albeit I've spotted its at <code>nvcr.io/nvidia/clara/</code></p>
<p>Docker, to be honest it's lazy by the developers. Docker is - techie packaging. So it's good for reviewers and behind web firewalls. It's useful but like you've just experienced  if it flops you're stuck. The one positive thing about Docker (apart from DevOps) is it's generally tolerated to package someone else's algorithm as part of a pipeline and let a third party 'pull it'. This is because they'll be a Dockerfile which can reconstruct the whole thing without copyright infringement. So if that first developer objects ... the Docker developer would just issue the Dockerfile. <code>conda</code> and stuff max out on that concept.</p>
<hr />
<p>There's a weird error as the OP described below.</p>
<p><strong>Right</strong> Docker uses by default a tag <code>latest</code> that does not work for parabricks. The tag must be <code>4.0.1-1</code>. Could you retry the above code please?</p>
<hr />
<p><strong>Update</strong> For good measure try the following:</p>
<pre><code>docker run  --rm -it --name mystuff  nvcr.io/nvidia/clara/clara-parabricks:4.0.1-1 --entrypoint /bin/bash
</code></pre>
<p>Might not be bash, thus</p>
<pre><code>docker run  --rm -it --name mystuff  nvcr.io/nvidia/clara/clara-parabricks:4.0.1-1 --entrypoint /bin/sh
</code></pre>
<p>They shouldn't throw an error, but you might still find you are outside the container after running it. Lets see.</p>
<hr />
<p><strong>Update</strong></p>
<p>The error looks okay, because a runtime error is exactly what would be expected if they are attempting to prevent access. Therefore please try:</p>
<pre><code>docker run --platform linux/amd64 --rm -it -u 0 --entrypoint /bin/sh  nvcr.io/nvidia/clara/clara-parabricks:4.0.1-1
</code></pre>
<p>This, or a variant of it, should work.</p>

CC BY-SA 4.0
2023-02-13T18:02:45.330Z
Thank you for the response! When I ran that command it didn't work, I get this error:
*edited*
 I've read that NVIDIA does not want to give access to the parabricks container
womy
CC BY-SA 4.0
2023-02-14T15:55:08.023Z
THANK YOU! I was able to get inside the container and run the command. For some reason, running it from within the container caused the output to be written to the metrics file... I'm not sure why it would be different, but I'm glad that it worked nonetheless. Thank you so much again for your help!
womy
CC BY-SA 4.0
2023-02-14T17:47:28.003Z
Just want to clarify that I read that nvidia doesn't want people to access the container somewhere on the dev forums, not in the documentation (and I was paraphrasing, the original dev response was "the best way to run parabricks is outside the container").  *edited*
womy
CC BY-SA 4.0
2023-02-14T17:51:59.513Z
Okay thanks @womy. Checked the forum, its fine.  *Note some of the comments in this thread have been deleted or edited to comply with extended discussion SE stuff*
M__
CC BY-SA 4.0
2023-02-13T16:36:09.310Z
2023-02-15T01:22:32.967Z
2023-02-15T01:22:32.967Z
M__
<p>This feels like a silly question, but I am testing parabricks bammetrics and nothing is being written to my output file. This is the command I am using:</p>
<pre><code>docker run \
  --rm \
  --volume ~/workdir:/workdir \
  --volume ~/ouputdir:/outputdir \
  -w /workdir nvcr.io/nvidia/clara/clara-parabricks:4.0.1-1 \
  pbrun \
  bammetrics \
  --ref /workdir/reference.fasta \
  --bam /workdir/cram.cram \
  --interval-file /workdir/regions.bed \
  --out-metrics-file /outputdir/metrics.txt
</code></pre>
<p>But metrics.txt doesn't have anything written in it when I open it after the command is run. Am I doing something wrong? I am very new to parabricks, so I assume I am missing something simple</p>
<p>I apologize if this is the wrong place to ask this question.</p>

<wgs><docker>
Why might parabricks not be writing output to the output file I provided?
# Why might parabricks not be writing output to the output file I provided?

(Asked by: username_0 on 2023-02-13)

This feels like a silly question, but I am testing parabricks bammetrics and nothing is being written to my output file. This is the command I am using:
docker run \
  --rm \
  --volume ~/workdir:/workdir \
  --volume ~/ouputdir:/outputdir \
  -w /workdir nvcr.io/nvidia/clara/clara-parabricks:4.0.1-1 \
  pbrun \
  bammetrics \
  --ref /workdir/reference.fasta \
  --bam /workdir/cram.cram \
  --interval-file /workdir/regions.bed \
  --out-metrics-file /outputdir/metrics.txt

But metrics.txt doesn't have anything written in it when I open it after the command is run. Am I doing something wrong? I am very new to parabricks, so I assume I am missing something simple
I apologize if this is the wrong place to ask this question.

**Tags:** wgs, docker

---

## 1 answers

### Answer by username_1 on 2023-02-13. Score: 3 | Accepted answer

EDIT Summary
For future users who encounter the problem the solution is,
docker run --platform linux/amd64 --rm -it -u 0 --entrypoint /bin/sh  nvcr.io/nvidia/clara/clara-parabricks:4.0.1-1

I am unhappy with the practice of limiting Docker access via blocking standard runtime: there are statements of intent on SE as a strategy to attempt to restrict Docker access. Parabricks isn't an isolated incident of deploying this setup within bioinformatics. However, I checked their forum and there is no statement of intent that it's deliberate. Parabrick's copyrights are here. There would be issues if there was ever an official statement to this extent. They would likely argue it was for other reasons to automate stuff.

Original answer ...
I don't know parabricks, but I know Docker. What you are attempting is to run Docker from the outside ... I would get on the inside to view the error log. Whats happening is the error is not being passed outside the container. Getting on the inside requires
docker run  --rm -it --name mydocker nvcr.io/nvidia/clara/clara-parabricks:4.0.1-1

This should give you access to the container. If it doesn't post back and I'll forward a different command that will. It's impossible to block access to a Docker container albeit some people try.
For simplicity is worth trying
docker run  --rm -it --name mydocker clara-parabricks:4.0.1-1

Anyway, if you are using this approach you'll need,
docker cp *outside container* *insider container* nvcr.io/nvidia/clara/clara-parabricks:4.0.1-1 and vice versa

... this is an amazing command and allows you to move data in and out of the container. You've got to get the data on the inside of the docker and docker cp does that very well. I would then look to running the whole thing from the inside of the container. Thats exactly how I run Dockers, then I exit and return when it's done. There might be a bit of clean via this approach, I'm not sure --rm might take care of it.
You'll also be able to look at the programs and copy it out onto hard drive. This last bit may be not advisable - the whole point of Docker is to protect your system from their algorithms ... but you can definitely do it and if you get it paired up with NextFlow thats cool.
I don't particularly want to pull the Docker container because they're often huge and I've no interest in the algorithm albeit I've spotted its at nvcr.io/nvidia/clara/
Docker, to be honest it's lazy by the developers. Docker is - techie packaging. So it's good for reviewers and behind web firewalls. It's useful but like you've just experienced  if it flops you're stuck. The one positive thing about Docker (apart from DevOps) is it's generally tolerated to package someone else's algorithm as part of a pipeline and let a third party 'pull it'. This is because they'll be a Dockerfile which can reconstruct the whole thing without copyright infringement. So if that first developer objects ... the Docker developer would just issue the Dockerfile. conda and stuff max out on that concept.

There's a weird error as the OP described below.
Right Docker uses by default a tag latest that does not work for parabricks. The tag must be 4.0.1-1. Could you retry the above code please?

Update For good measure try the following:
docker run  --rm -it --name mystuff  nvcr.io/nvidia/clara/clara-parabricks:4.0.1-1 --entrypoint /bin/bash

Might not be bash, thus
docker run  --rm -it --name mystuff  nvcr.io/nvidia/clara/clara-parabricks:4.0.1-1 --entrypoint /bin/sh

They shouldn't throw an error, but you might still find you are outside the container after running it. Lets see.

Update
The error looks okay, because a runtime error is exactly what would be expected if they are attempting to prevent access. Therefore please try:
docker run --platform linux/amd64 --rm -it -u 0 --entrypoint /bin/sh  nvcr.io/nvidia/clara/clara-parabricks:4.0.1-1

This, or a variant of it, should work.

> **Comments:**
> **username_0**: Thank you for the response! When I ran that command it didn't work, I get this error: *edited*  I've read that NVIDIA does not want to give access to the parabricks container  
> **username_0**: THANK YOU! I was able to get inside the container and run the command. For some reason, running it from within the container caused the output to be written to the metrics file... I'm not sure why it would be different, but I'm glad that it worked nonetheless. Thank you so much again for your help!  
> **username_0**: Just want to clarify that I read that nvidia doesn't want people to access the container somewhere on the dev forums, not in the documentation (and I was paraphrasing, the original dev response was "the best way to run parabricks is outside the container").  *edited*  
> **username_1**: Okay thanks @womy. Checked the forum, its fine.  *Note some of the comments in this thread have been deleted or edited to comply with extended discussion SE stuff*  

---

