As you did, you need to modify Dockerfile at all times to change the value of the USER and PASSWORD variables. Also need to rebuild the image with Docker build -t ..
Obviously, it is not very practical and is also not very feasible if you want to distribute this image via the Docker Hub so that the user only needs to inform his password through the command Docker run -e.
Before, remember that variables passed through the option -and or command ENV in Dockerfile have seen environment variables in the shell. So you can have a script file, for example, run sh.. He can be more or less like this:
#!/bin/bash
git clone git clone https://"$USUARIO_BITBUCKET":"$SENHA_BITBUCKET"@bitbucket.org/.../...
In your Dockerfile, which you will use to create your image, modify to something like this:
FROM ubuntu
ADD run.sh run.sh
RUN chmod +x run.sh
CMD ./run.sh
When you run this container with the command below, it will use the environment variables passed in the command run.
docker run --name teste -ti -e USUARIO_BITBUCKET=123 -e SENHA_BITBUCKET=123 nomeimagem