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.


1 Answer 1


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.


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.

  • 1
    $\begingroup$ 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 $\endgroup$
    – womy
    Feb 13, 2023 at 18:02
  • 1
    $\begingroup$ 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! $\endgroup$
    – womy
    Feb 14, 2023 at 15:55
  • $\begingroup$ 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 $\endgroup$
    – womy
    Feb 14, 2023 at 17:47
  • $\begingroup$ 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 $\endgroup$
    – M__
    Feb 14, 2023 at 17:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.