What is the docker run -r flag

862 Views Asked by At

I am looking at this repo: https://github.com/zricethezav/gitleaks

To run with Docker we'd use

docker run --rm --name=gitleaks zricethezav/gitleaks -v -r https://github.com/zricethezav/gitleaks.git

I am having trouble figuring out what the -r flag is doing...it doesn't look like it's making it read-only, does anyone know?

https://docs.docker.com/engine/reference/commandline/run/

1

There are 1 best solutions below

2
On BEST ANSWER

The -v -r ... apply to the container process not to the docker command.

The way to read this is in 2 parts:

  1. Run a command gitleaks using docker run --rm --name=gitleaks zricethezav/gitleaks

  2. Provide gitleaks flags and params with -v -r https://github.com/zricethezav/gitleaks.git

You can (often) determine what flags|parameters a container instance wants by running the process without any flags|parameters or giving it --help, i.e.

docker run -it --name=gitleaks zricethezav/gitleaks --help
Usage:
  gitleaks [OPTIONS]

Application Options:
  -r, --repo=          Repo url to audit
...
Example:
...
  -v, --verbose        Show verbose output from gitleaks audit
...