I am trying to run a docker command for achieving following steps with a single line of command.
A) Pulling a docker image,
B) Then starting the container,
C) Do a volume mount of a directory from host to launched container,
D) And then gives scan command, inside container to capture reports.
I could achieve steps a, b and c with this command.
$ docker run -d -it --name test -v /root/tools:/var/local <mydocker-image-registry>
But for the last step, D, ie., to run a scan inside the container and capturing reports, I am unable to add that piece of command to above command and get it working.
This below piece of command works independently but could not append to above line and get it working.
<scan> -s python -o ./reports
The container just started and exited when given below command
docker run -d -it --name test -v /root/tools:/var/local <mydocker-image-registry> <scan> -s python -o ./reports
Also did some basic search and tried to add an Entrypoint as below
docker run -d -it --name test -v /root/tools:/var/local <mydocker-image-registry> -- entrypoint <scan> -s python -o ./reports
But that didn't work either. Just got an error docker: Error response from daemon: OCI runtime create failed: container_linux.go:345: starting container process caused "exec: \"--\": executable file not found in $PATH": unknown.
Expecting to achieve all above 4 steps executed with single docker command and I get 'reports' populated with results.