gunicorn: error: unrecognized arguments while deploying API on docker

I am trying to deploy a Flask API on docker. After running the script using Docker with gunicorn package in place, I get the following error: gunicorn: error: unrecognized arguments.

There was a similar stackoverflow query, which said it is because of argsparse: Python, Flask, Gunicorn Error: Unrecognized Arguments .

As suggested on that, I changed the python script argsparse to
args, unknown = parser.parse_known_args(). But after this implementation as well, I am encountering the same issue i.e. gunicorn: error: unrecognized arguments. How to fix this issue?

Source: Docker Questions