Loadimpact/k6: Docker container exiting with script as input
This actually helps me.
Dockerfile:
FROM loadimpact/k6
COPY script.js /
Build Command:
docker build -t load-testing -f Dockerfile .
Run Command:
docker run -d load-testing run --vus 250 --duration 60m script.js
You have to create a new Docker image that will only run your code. I would suggest you read the Docker documents once,all you have to do is create a new Docker image that will only run your application.
i think this Dockerfile will work:
vi Dockerfile
FROM loadimpact/k6
COPY script.js /script.js
CMD ["run", "script.js","--vus","250","--duration","60m"]
copy your own script and Dockerfile into a folder and then run the following command:(It could be wrong because I don't have the files, and I haven't been able to test.)
docker build -t yourdesirename .
it will create a new docker image with name you enternd and latest tag now you can run it in background
docker run -d yourdesirename:latest