"Singularity exec" vs "docker run"

I have a cwl workflow that I can run either with docker or singularity. I understand the difference betweeen singularity exec vs docker run. My question is slightly different. Sorry for not being clear on that. Let me try to add some clarity.

Here is how I run a workflow with toil and choosing to use the docker container.

toil_cwl_runner /home/samee/bin/miniforge3/envs/sophios_dev/bin/sophios --disable-pull --cachedir cachedir --provenance provenance/bbbc --write-summary output_bbbc.json --skip-schemas --relax-path-checks --leave-outputs autogenerated/bbbc.cwl autogenerated/bbbc_inputs.yml

In this case I see that docker uses the run command to run the container.

docker \
    run \
    -i \
    --mount=type=bind,source=/home/samee/axle_dev/image-workflows/cachedir/b4aed9ba9b80fef2ca574a2febca212d,target=/zXKUXM \
    --mount=type=bind,source=/tmp/_a41e33r,target=/tmp \
    --workdir=/zXKUXM \
    --read-only=true \
...

However if I run the same workflow using singularity (by passing --singularity) in the command line, like following:

toils_cwl_runner /home/samee/bin/miniforge3/envs/sophios_dev/bin/sophios --disable-pull --cachedir cachedir --provenance provenance/bbbc --singularity --write-summary output_bbbc.json --skip-schemas --relax-path-checks --leave-outputs autogenerated/bbbc.cwl autogenerated/bbbc_inputs.yml

I see singularity exec is used by toil:

singularity \
    --quiet \
    exec \
    --contain \
    --ipc \
    --cleanenv \
    --userns \
....

So, my question is why the toil devs chose to use exec for singularity but run for docker?

Hope this makes my question clear :slight_smile: