question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error with --email flag deprecation for `docker login`

See original GitHub issue

In the 17.0.6 docker engine update, the -e and --email flags were deprecated. Sending the -e flag now results in a 400 error. The client should attempt to check the docker version or re-try without the email flag if it fails. This is a breaking change in the docker application, and should be fixed as soon as possible.

https://docs.docker.com/engine/deprecated/#-e-and---email-flags-on-docker-login

Originally encountered this issue with

$(aws ecr get-login)

This calls:

docker login -u AWS -p <TOKEN> -e none <ECR_URL>

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

11reactions
timwahcommented, Feb 6, 2018

I had the same issue until I realized that the tokens are base64 encoded - RTFM fail 😦.

session = boto3.Session()
ecr = session.client('ecr')
login = ecr.get_authorization_token()
b64token = login['authorizationData'][0]['authorizationToken'].encode('utf-8')
username, password = base64.b64decode(b64token).decode('utf-8').split(':')
registry = login['authorizationData'][0]['proxyEndpoint']

client = docker.from_env()
client.login(username, password, registry=registry)
11reactions
mrosalescommented, Jul 4, 2017

Sorry, shouldn’t have included the ecr bit in the issue. That was just how I was first made aware of the deprecation. I was collecting the URL and token from the ecr python sdk, and then using docker-py sdk to call docker login (not including an email field).

The code segment worked before upgrading to docker 17.0.6 yesterday, and then it stopped working. Calling the command line docker login with the token and URL from the python ECR command works fine.

This was the call I made. Using the same param values here in the command line worked fine, but failed in docker-py

docker.login(
                username="AWS",
                password=auth_data['authorizationToken'],
                registry=auth_data['proxyEndpoint']
               )

The error is:

docker.errors.APIError: 500 Server Error: Internal Server Error ("login attempt to https://<AWS_ID>.dkr.ecr.<REGION>.amazonaws.com/v2/ failed with status: 400 Bad Request")
Read more comments on GitHub >

github_iconTop Results From Across the Web

docker login unknown flag: --no-include-email - Stack Overflow
The --no-include-email flag is an AWS CLI flag, not a docker flag. To use it, add it to your get-login call: $ aws...
Read more >
Deprecated Engine Features - Docker Documentation
To make tagging consistent across the various docker commands, the -f flag on the docker tag command is deprecated. It is not longer...
Read more >
Use kaniko to build Docker images - GitLab Docs
kaniko is a tool to build container images from a Dockerfile, inside a container or Kubernetes cluster. kaniko solves two problems with using...
Read more >
Deprecated Engine Features - | Docker Documentation
The docker login command is removing the ability to automatically register for an account with the target registry if the given username doesn't...
Read more >
Red Hat Quay Release Notes
(#2041, #2127, #2186, #2189, #2190); Notifications when a build is canceled (#2173, #2184); Remove deprecated email flag from generated docker login ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found