Reputation: 933
I am trying to run the official bwa docker https://hub.docker.com/r/biocontainers/bwa/, and I keep getting an error:
sudo docker run -u="root" -v ~/files/:/opt/inputs/ biocontainers/bwa "index /opt/inputs/hg19.fa"
docker: Error response from daemon: OCI runtime create failed: container_linux.go:348: starting container process caused "exec: \"index /opt/inputs/hg19.fa\": stat index /opt/inputs/hg19.fa: no such file or directory": unknown.
ERRO[0000] error waiting for container: context canceled
EDIT: Removing the double quotes from the lst string gives a different error:
sudo docker run -u="root" -v ~/files/:/opt/inputs/ biocontainers/bwa index /opt/inputs/hg19.fa
docker: Error response from daemon: OCI runtime create failed: container_linux.go:348: starting container process caused "exec: \"index\": executable file not found in $PATH": unknown.
I have found the reason behind it here:
docker: executable file not found in $PATH
This is the correct reason, but since this file was pre-build, and I want to use the official release, I cannot change the CMD synthax in Dockerfile. How can I make this work without changing the container itself?
Upvotes: 1
Views: 2420
Reputation: 263469
since this file was pre-build, and I want to use the official release, I cannot change the CMD synthax in Dockerfile
Actually you did change the setting of CMD in your run command. Everything after the image name overrides the default CMD value shipped with the image:
sudo docker run -u="root" -v ~/files/:/opt/inputs/ biocontainers/bwa "index /opt/inputs/hg19.fa"
docker: Error response from daemon: OCI runtime create failed: container_linux.go:348: starting container process caused "exec: \"index /opt/inputs/hg19.fa\": stat index /opt/inputs/hg19.fa: no such file or directory": unknown.
ERRO[0000] error waiting for container: context canceled
In this case, you have replaced the bwa
value of CMD shipped in the Dockerfile with "index /opt/inputs/hg19.fa"
. Note the quotes and space are included in the executable you are trying to run. It is not trying to run index
with an argument /opt/inputs/hg19.fa
as you may have expected. This is why you see the error message:
"exec: \"index /opt/inputs/hg19.fa\": stat index /opt/inputs/hg19.fa: no such file or directory"
To run the command index
, remove the quotes:
sudo docker run -u="root" -v ~/files/:/opt/inputs/ biocontainers/bwa index /opt/inputs/hg19.fa
Upvotes: 3