Docker Community Forums

Share and learn in the Docker community.

File creation in docker


(Poorvig89) #1

I have a bash script as:

#!/bin/bash

now=$(date +"%m_%d_%Y")
touch /scripts/personalizer/benchmarking/$now.txt
esrally --pipeline=benchmark-only --target-hosts= --track-path=rally/track.json --on-error=abort --client-options=“timeout:60” --report-file /scripts/personalizer/benchmarking/$now.txt

and my docker file looks like:
FROM gurken2108/python3-java

RUN pip install --upgrade pip
RUN pip3 install esrally
RUN apt-get update && apt-get install -y nano && apt-get clean

COPY [“rally.ini”, “/root/.rally/rally.ini”]

WORKDIR /scripts/personalizer/benchmarking
ADD . /scripts/personalizer/benchmarking

CMD /bin/bash /scripts/personalizer/benchmarking/benchmark.sh

However I do not see the report being created .
But, when I run the script directly in docker it works.
Could someone please let me know what do I need to get the file created and then get it outside of container