I am able to pass the environment variables using -e option. But i am not sure how to pass command line arguments to the jar in entrypoint using the docker run command.
Dockerfile
FROM openjdk
ADD . /dir
WORKDIR /dir
COPY ./test-1.0.1.jar /dir/test-1.0.1.jar
ENTRYPOINT java -jar /dir/test-1.0.1.jar
test.sh
#! /bin/bash -l
export AWS_ACCESS_KEY_ID=$(aws configure get aws_access_key_id)
export AWS_SECRET_ACCESS_KEY=$(aws configure get aws_secret_access_key)
$value=7
docker run -e AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY -i -t testjava $value
question from:https://stackoverflow.com/questions/53543881/docker-run-pass-arguments-to-entrypoint