Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker login failing (at most 1 argument)

Tags:

docker

I am failing to login to a remote docker registry using a command of the form:

docker login –u my-username –p my-password registry.myclient.com

The error I get is the following:

"docker login" requires at most 1 argument.
See 'docker login --help'.

Usage:  docker login [OPTIONS] [SERVER]

How can login to the remote registry?

like image 317
Tyler Durden Avatar asked Nov 07 '17 20:11

Tyler Durden


People also ask

How do I fix the docker build requires exactly one argument?

The most common reason for “Docker build Requires 1 Argument” error is when we try to build the image without providing sufficient arguments. Here, in the arguments, we need to provide the directory with the command.

What is the default user Do you login with docker?

The default user in a Dockerfile is the user of the parent image. For example, if your image is derived from an image that uses a non-root user example: swuser , then RUN commands in your Dockerfile will run as swuser .

What is password Stdin?

Using STDIN prevents the password from ending up in the shell's history, or log-files. The following example reads a password from a file, and passes it to the docker login command using STDIN : $ cat ~/my_password.txt | docker login --username foo --password-stdin.


2 Answers

You don't have tacks in front of your options, it's some other dash like character. Try this instead:

docker login -u my-username -p my-password registry.myclient.com

While it looks similar, -u and -p are not the same as –u and –p.

like image 64
BMitch Avatar answered Oct 05 '22 19:10

BMitch


This one worked for me if ci environment is in play:

echo ${MVN_PASSWORD} | docker login -u ${MVN_USER} --password-stdin ${MVN_URL}

these variables need to be set up via Settings > CI/CD > Variables (gitlabci example)

like image 36
im_infamous Avatar answered Oct 05 '22 20:10

im_infamous