Passing credentials inside docker container in the form of a wrapper as an env variable

  devops, docker, dockerfile

In my dockerfile:::-

   ENTRYPOINT exec java $JAVA_OPTS -jar /apps/service.jar --spring.profiles.active=$env --spring.cloud.config.server.git.uri=$configRepo 
--spring.cloud.config.server.git.password=$password --spring.cloud.config.server.git.username=$username 

I have removed the $username and $password in ENV instruction in my dockerfile but still the same credentials are required to pass inside the ENTRYPOINT instruction but I dont have these credentials anymore in my dockerfile file.

Question: Is there a safer way to use those credentials in ENTRYPOINT at run-time?
Do I need to create a wrapper script and call that wrapper at run-time? How can I add these git logins to a wrapper script so that the script can be called at run-time?

I need to use credentials as env at run-time.

Source: Docker Questions

LEAVE A COMMENT