Dockerfile based on container behind login

The base I want to use for my container is stored on a repository that I have to login to gain access. How do I do this in a Dockerfile? So far I have:

ARG user
ARG password


uhm, what? You objective is completly unclear.

Sorry, this is the wrong forum for my question.

I assume you mean to use a base image located in a repository on a private registry?

If so, then you need to login at the private registy, before interacting with it:
docker login fqdn{:port} (=without the https:// prefix)
you only need to specifiy the port, if the remote registry is not running on port 443.

You approach with the ARGs is not how it works. Don’t forget to use fqdn:port/group/repo:tag when adressing the base image in the FROM declaration.