I want to create an image , with git pre-installed that can log in Github during docker-run.
This image suppose to get Github username and token in docker-run command through -e option.
For example :
sudo docker run -it --rm -e "username=parsalotfy" -e "token=secretsecretsecret" -e "[email protected]" gitloggedin
I wrote Dockerfile like this :
FROM alpine
RUN apk update
RUN apk upgrade
RUN apk add git
RUN git clone https://$username:[email protected]/$username/$repo.git
RUN cd $repo/
RUN git config user.email $email
COPY entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
But when I want to build this Dockerfile, this error occurs :
What am I doing wrong here?
And How can I have a Github user logged in passing username and password through -e option after docker-run ?
Thank you.

DOCKER_BUILDKIT?Dockerfilenone of those variables are defined; thedocker buildcommand doesn't know what arguments thedocker runwill eventually be invoked with. For a couple of reasons I'd suggest checking out the source tree you're trying to build outside of theDockerfile, and picking a specific filesystem path inside the image.