Different behaviour running command via bash vs command line

I have build a docker with the follow command

docker build    \
-t bethelsight/november-bix:latest    \
--build-arg HOST=192.168.0.14    \
--build-arg PORT=8000    \
--build-arg CONDA_PACKAGE=Anaconda3-2022.10-Linux-x86_64.sh    \
--file Dockerfile .

The content of the Dockerfile is

FROM bethelsight/november-ubuntu-22

# most bioinformatics tools are installed via conda
# See this for conda activation within a Dockerfile - https://pythonspeed.com/articles/activate-conda-dockerfile/#working
ARG HOST
ARG PORT
ARG CONDA_PACKAGE

ENV ENV_HOST=$HOST
ENV ENV_PORT=$PORT
ENV ENV_CONDA_PACKAGE=$CONDA_PACKAGE

# Conda environment configuration file
COPY environment.yml /tmp

LABEL maintainer="yue.nicholas@gmail.com"

RUN apt -y update && apt install -y build-essential cmake ninja-build

RUN cd /tmp && curl -L -O http://${ENV_HOST}:${ENV_PORT}/${ENV_CONDA_PACKAGE}

# Installation
RUN sh /tmp/${ENV_CONDA_PACKAGE} -b

# Setup/initialization
# NOTE : Keep everything in a SINGLE call
RUN . /root/anaconda3/bin/activate && \
    conda init bash && \
    conda config --set auto_activate_base false && \
    conda update -y -n base -c defaults conda && \
    conda env create -f /tmp/environment.yml

# Clean up
RUN cd /tmp && rm *.sh

# Make RUN commands use the new environment:
RUN echo "export PATH=/root/anaconda3/envs/bix/bin:\$PATH" >> ~/.bashrc
RUN echo "export PATH=/usr/examples/bioinformatics/bin:\$PATH" >> ~/.bashrc
RUN echo "conda activate bix" >> ~/.bashrc

# This ensures that a shell will source ~/.bashrc since
# we are making it a "login" shell
SHELL ["/bin/bash", "--login", "-c"]

The parent docker image has a custom built (c++) command line application call cnov

cnov when run without and options simply prints out the required arguments

Allowed options:
  --version             print version string
  --plugins             list all plugins
  --help                produce help message
  --info                produce summary of project without executing target 
                        [Optional]
  --project arg         name of a project file (GML) [Mandatory].
  --inputs arg          name of an inputs definition file (JSON) [Optional].
  --outputs arg         name of an outputs definition file (JSON) [Optional].
  --maps arg            name of an globals mapping file (JSON) [Required if 
                        either inputs/outputs JSON is specified].
  --target arg          target node Name [Optional if requesting info].

When I run it via the following way

docker run \
-v /data1/nyue/temp/bix:/tmp/data     \
-v .:/tmp/json     bethelsight/november-bix cnov

I get the expected print out. This tells me that cnov is available and in the path
Note: I did check that cnov is not in my current host machine

However, when I tried it out with actual parameters that I have tested as working, it runs part way and terminated

docker run \
-v /data1/nyue/temp/bix:/tmp/data     \
-v .:/tmp/json     \
bethelsight/november-bix cnov     \
--project /tmp/data/input/rnaseq.gml     \
--inputs /tmp/json/inputs.json     \
--outputs /tmp/json/outputs.json     \
--maps /tmp/json/globals-map.json     \
--target trimmomatic_1

Whereas if I launch a bash shell

docker run \
-v /data1/nyue/temp/bix:/tmp/data     \
-v .:/tmp/json     \
bethelsight/november-bix bash

and invoke cnov inside the shell, it runs through to completion and produces the expected output data files

root@066d3644efd3:/# cnov --project /tmp/data/input/rnaseq.gml --inputs /tmp/json/inputs.json --outputs /tmp/json/outputs.json --maps /tmp/json/globals-map.json --target trimmomatic_1
Project file is /tmp/data/input/rnaseq.gml
project_file variable /tmp/data/input/rnaseq.gml
Inputs definition file is /tmp/json/inputs.json
inputs_file variable /tmp/json/inputs.json
Outputs definition file is /tmp/json/outputs.json
outputs_file variable /tmp/json/outputs.json
Globals mapping file is /tmp/json/globals-map.json
maps_file variable /tmp/json/globals-map.json
Target node is trimmomatic_1
target variable trimmomatic_1
2023-09-19 17:50:24: <info> CommandLineNode::compute() command being executed is '/root/anaconda3/envs/bix/bin/trimmomatic SE -threads 4 /tmp/data/input/CPCT12345678R_HJJLGCCXX_S1_L001_R2_001.fastq.gz /tmp/data/output/trimmed.fastq TRAILING:10 -phred33'
TrimmomaticSE: Started with arguments:
 -threads 4 /tmp/data/input/CPCT12345678R_HJJLGCCXX_S1_L001_R2_001.fastq.gz /tmp/data/output/trimmed.fastq TRAILING:10 -phred33
Input Reads: 8952 Surviving: 8952 (100.00%) Dropped: 0 (0.00%)
TrimmomaticSE: Completed successfully
2023-09-19 17:50:25: <info> CommandLineNode::compute() _stdout = ''

I am trying to determine if the way I am building docker image via my Dockerfile, I am not setting it up correctly.

Thank you in advanced.

Answering my own question, my solution for my particular situation with conda involved was to use ENTRYPOINT

Here is the current Dockerfile which I am using successfully, hope it helps others in the future

FROM bethelsight/november-ubuntu-22

ARG HOST
ARG PORT
ARG CONDA_PACKAGE

ENV ENV_HOST=$HOST
ENV ENV_PORT=$PORT
ENV ENV_CONDA_PACKAGE=$CONDA_PACKAGE

COPY environment.yml /tmp

LABEL maintainer="yue.nicholas@gmail.com"

RUN apt -y update && apt install -y build-essential cmake ninja-build

RUN cd /tmp && curl -L -O http://${ENV_HOST}:${ENV_PORT}/${ENV_CONDA_PACKAGE}

RUN sh /tmp/${ENV_CONDA_PACKAGE} -b

RUN . /root/anaconda3/bin/activate && \
    conda init bash && \
    conda config --set auto_activate_base false && \
    conda update -y -n base -c defaults conda && \
    conda env create -f /tmp/environment.yml

RUN cd /tmp && rm *.sh

ENTRYPOINT ["/root/anaconda3/condabin/conda", "run", "--no-capture-output", "-n", "bix"]