Dockerizing the script

Hi Team
I am working on a project where we have so many API scripts (multiple team developing different APIs). So the requirement is I need to create a common docker image where they can pass a script name as an input and it has to run as docker container (probably in docker-compose with grafana/influxdb). So I created a shell script which accepts a script name as an input and execute k6 test.

#!/bin/bash
SCRIPTNAME=$1
k6_test='k6 run '$SCRIPTNAME''
$k6_test
sleep 10

Below is the snapshot of script folder structure

image

I wrote the docker file like below

FROM loadimpact/k6
COPY . .
ENTRYPOINT ["test.sh"]

But its not working. See the below error.

Can you please help me to create the docker file for this setup?
Thank you so much

Hi @satheeshpandianj
Docker container does not have access to the files in your OS filesystem so those files must be either copied during image creation or mounted on start of container with -v.
In the case you described, that is probably true for both test.sh and JS files. Since there are a lot of files, it’s likely easier to copy them in Dockerfile though it also may depend on exact requirements of the further deployment.