I have a very big file which needs to be passed as an Environment variable to Docker run command in linux ec2 platform.
My ideal docker command looks like this :
docker run -p 6080:9000 -e KAFKA_BROKERCONNECT=url:port -e KAFKA_TRUSTSTORE="$(cat directory/kafka.client.truststore.jks | base64)" -e KAFKA_KEYSTORE="$(cat directory/kafka.client.keystore.jks | base64)" -e KAFKA_PROPERTIES="$(cat directory/kafka.properties | base64)" -e SERVER_SERVLET_CONTEXTPATH="/" -d obsidiandynamics/kafdrop
I get /bin/docker : Argument list too long
So instead of doing the above, i passed all the Env variables from the file kafdrop-properties file looks like :
KAFKA_BROKERCONNECT=host:port
KAFKA_TRUSTSTORE="$(cat 2kafka.client.truststore.jks)"
KAFKA_KEYSTORE="$(cat 2kafka.client.keystore.jks)"
KAFKA_PROPERTIES="$(cat /home/de601928/kafka/kafka.properties | base64)
and the corresponding Docker run command :
docker run -p 6080:9000 --env-file kafdrop-properties -d obsidiandynamics/kafdrop
Now after i run the command, i still see the enviroment variables like KAFKA_TRUSTSTORE are not reading via the cat content and displays as it is when i run docker exec env
Why isnt the cat command not reading from the file and passing the value as the Environment variable argument .
I have tried different ways like giving "<file" , etc. Appreciate any help here.