Error unauthorized authentication required docker

I have created and uploaded a docker image in docker hub. I have made it public. But sometimes, While pulling the docker image, I am getting the below error. unauthorized: authentication required N...

I am seeing this error:

docker pull tryretool/backend:2.63.5
2.63.5: Pulling from tryretool/backend
e9afc4f90ab0: Already exists 
989e6b19a265: Already exists 
af14b6c2f878: Already exists 
5573c4b30949: Already exists 
11a88e764313: Downloading [================================>                  ]    123MB/192.2MB
11a88e764313: Downloading [================================================>  ]  184.5MB/192.2MB
cb0e1ed30eeb: Download complete 
0b9c9c21cd20: Download complete 
54e8a3ee7d4f: Download complete 
4ac7f1cac0b4: Download complete 
7e75f382a198: Downloading [===============>                                   ]  123.2MB/388.8MB
7e75f382a198: Downloading [=======================>                           ]  186.3MB/388.8MB
1c33ad28db5d: Download complete 
7bab2c3ebdf5: Download complete 
851863d6793e: Downloading [==========>                                        ]  15.53MB/75.56MB
851863d6793e: Download complete 
5a840ab65046: Downloading 
e76dc5738f04: Waiting 
3504aaff1fc5: Waiting 
3c4d87b73310: Waiting 
01cfc24ca80d: Waiting 
65815ffbce30: Waiting 
dfb85f79de02: Waiting 
a554fcfc19f5: Waiting 
effe81583c81: Waiting 
2c591f71baef: Waiting 
08a9eae6122d: Waiting 

unauthorized: authentication required

when pulling the image tryretool/backend:2.63.5 using these versions of docker client and server.

Client: Docker Engine - Community
 Version:           18.09.0
 API version:       1.39
 Go version:        go1.10.4
 Git commit:        4d60db4
 Built:             Wed Nov  7 00:46:51 2018
 OS/Arch:           linux/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          18.09.0
  API version:      1.39 (minimum version 1.12)
  Go version:       go1.10.4
  Git commit:       4d60db4
  Built:            Wed Nov  7 00:52:55 2018
  OS/Arch:          linux/amd64
  Experimental:     false

It works fine when I pull using these versions of client and server (on another machine):

Client: Docker Engine - Community
 Version:           19.03.12
 API version:       1.39
 Go version:        go1.14.4
 Git commit:        48a6621
 Built:             Sat Jul  4 17:04:36 2020
 OS/Arch:           darwin/amd64
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          18.09.0
  API version:      1.39 (minimum version 1.12)
  Go version:       go1.10.4
  Git commit:       4d60db4
  Built:            Wed Nov  7 00:52:55 2018
  OS/Arch:          linux/amd64
  Experimental:     false

The error occurs whether I have logged in (with docker login) or not.

Содержание

  1. docker unauthorized: authentication required — upon push with successful login
  2. 31 Answers 31
  3. Step 1: log in to docker hub
  4. Step 2: create a repository in the docker hub.
  5. Troubleshoot registry login
  6. Symptoms
  7. Causes
  8. Further diagnosis
  9. Potential solutions
  10. Check Docker configuration
  11. Specify correct registry name
  12. Confirm credentials to access registry
  13. Confirm credentials are authorized to access registry
  14. Check that credentials aren’t expired
  15. Advanced troubleshooting
  16. Next steps
  17. docker unauthorized: требуется аутентификация — при нажатии с успешным входом в систему
  18. 17 ответов:

While pushing the docker image (after successful login) from my host I am getting «unauthorized: authentication required».

  • Docker version: 1.9.1 (both client and server)
  • http://hub.docker.com has the repo created as well (asamba/docker-whale).

The /var/log/messages shows 403, I dont know if this docker. See below.

Any help is appreciated, please let me know if you need further info. I did the push with -f as well. No luck!

31 Answers 31

You’ll need to log in to Docker.

Step 1: log in to docker hub

Based on @KaraPirinc’s comment, in Docker version 17 in order to log in:

Then enter your password when asked.

Step 2: create a repository in the docker hub.

Let’s say «mysqlserver:sql«.

OK! never mind; I found the solution. with 403 Suspected that the HTTP is not going to the right URL.

Change the file which has the login credentials stored the

/.docker/config.json from the default generated of

to — Note the change from docker.io -> index.docker.io/v1. That is the change.

Hope that helps.

Note that the auth field should be ‘username:password» base64 encoded. for example: «username:password» base64 encoded is «dXNlcm5hbWU6cGFzc3dvcmQ=»

so your file would contain:

The solution you posted is not working for me.

This is what works for me:

Create the repository with the desired name.

When committing the image, name the image like the repository, including the username /desired-name . For example, radu/desired-name .

if you are using heroku, be sure you did not forget to «heroku container:login» before pushing.

The problem newbies face is that we tend to treat docker hub repository just like a maven repository and think that it might contain many a different files, folders and other contents.

A docker repository on the other hand is just a single image, it does not contain anything else. It can hold different versions of the same image, but its going to contain just one image.

So, name your repository on docker hub the same name as the image you want to push into it, and use your dockerhub username as prefix. For eg, if your username is myusername and your image name is docker-whale , make sure to name your dockerhub repository as docker-whale and use the below commands to tag and push your image to repository:

Источник

Troubleshoot registry login

This article helps you troubleshoot problems you might encounter when logging into an Azure container registry.

Symptoms

May include one or more of the following:

  • Unable to login to registry using docker login , az acr login , or both
  • Unable to login to registry and you receive error unauthorized: authentication required or unauthorized: Application not registered with AAD
  • Unable to login to registry and you receive Azure CLI error Could not connect to the registry login server
  • Unable to push or pull images and you receive Docker error unauthorized: authentication required
  • Unable to access a registry using az acr login and you receive error CONNECTIVITY_REFRESH_TOKEN_ERROR. Access to registry was denied. Response code: 403. Unable to get admin user credentials with message: Admin user is disabled. Unable to authenticate using AAD or admin login credentials.
  • Unable to access registry from Azure Kubernetes Service, Azure DevOps, or another Azure service
  • Unable to access registry and you receive error Error response from daemon: login attempt failed with status: 403 Forbidden — See Troubleshoot network issues with registry
  • Unable to access or view registry settings in Azure portal or manage registry using the Azure CLI

Causes

  • Docker isn’t configured properly in your environment — solution
  • The registry doesn’t exist or the name is incorrect — solution
  • The registry credentials aren’t valid — solution
  • The registry public access is disabled. Public network access rules on the registry prevent access — solution
  • The credentials aren’t authorized for push, pull, or Azure Resource Manager operations — solution
  • The credentials are expired — solution

Further diagnosis

Run the az acr check-health command to get more information about the health of the registry environment and optionally access to a target registry. For example, diagnose Docker configuration errors or Azure Active Directory login problems.

See Check the health of an Azure container registry for command examples. If errors are reported, review the error reference and the following sections for recommended solutions.

Follow the instructions from the AKS support doc if you fail to pull images from ACR to the AKS cluster.

Some authentication or authorization errors can also occur if there are firewall or network configurations that prevent registry access. See Troubleshoot network issues with registry.

Potential solutions

Check Docker configuration

Most Azure Container Registry authentication flows require a local Docker installation so you can authenticate with your registry for operations such as pushing and pulling images. Confirm that the Docker CLI client and daemon (Docker Engine) are running in your environment. You need Docker client version 18.03 or later.

Specify correct registry name

When using docker login , provide the full login server name of the registry, such as myregistry.azurecr.io. Ensure that you use only lowercase letters. Example:

When using az acr login with an Azure Active Directory identity, first sign into the Azure CLI, and then specify the Azure resource name of the registry. The resource name is the name provided when the registry was created, such as myregistry (without a domain suffix). Example:

Confirm credentials to access registry

Check the validity of the credentials you use for your scenario, or were provided to you by a registry owner. Some possible issues:

  • If using an Active Directory service principal, ensure you use the correct credentials in the Active Directory tenant:
    • User name — service principal application ID (also called client ID)
    • Password — service principal password (also called client secret)
  • If using an Azure service such as Azure Kubernetes Service or Azure DevOps to access the registry, confirm the registry configuration for your service.
  • If you ran az acr login with the —expose-token option, which enables registry login without using the Docker daemon, ensure that you authenticate with the username 00000000-0000-0000-0000-000000000000 .
  • If your registry is configured for anonymous pull access, existing Docker credentials stored from a previous Docker login can prevent anonymous access. Run docker logout before attempting an anonymous pull operation on the registry.

Confirm credentials are authorized to access registry

Confirm the registry permissions that are associated with the credentials, such as the AcrPull Azure role to pull images from the registry, or the AcrPush role to push images.

Access to a registry in the portal or registry management using the Azure CLI requires at least the Reader role or equivalent permissions to perform Azure Resource Manager operations.

If your permissions recently changed to allow registry access though the portal, you might need to try an incognito or private session in your browser to avoid any stale browser cache or cookies.

You or a registry owner must have sufficient privileges in the subscription to add or remove role assignments.

Check that credentials aren’t expired

Tokens and Active Directory credentials may expire after defined periods, preventing registry access. To enable access, credentials might need to be reset or regenerated.

  • If using an individual AD identity, a managed identity, or service principal for registry login, the AD token expires after 3 hours. Log in again to the registry.
  • If using an AD service principal with an expired client secret, a subscription owner or account administrator needs to reset credentials or generate a new service principal.
  • If using a repository-scoped token, a registry owner might need to reset a password or generate a new token.

Advanced troubleshooting

If collection of resource logs is enabled in the registry, review the ContainerRegistryLoginEvents log. This log stores authentication events and status, including the incoming identity and IP address. Query the log for registry authentication failures.

Next steps

If you don’t resolve your problem here, see the following options.

  • Other registry troubleshooting topics include:
    • Troubleshoot network issues with registry
    • Troubleshoot registry performance
  • Community support options
  • Microsoft Q&A
  • Open a support ticket — based on information you provide, a quick diagnostic might be run for authentication failures in your registry

Источник

docker unauthorized: требуется аутентификация — при нажатии с успешным входом в систему

при нажатии на изображение docker (после успешного входа в систему) с моего хоста я получаю «несанкционированный: требуется аутентификация».

  • Докер версия: 1.9.1 (как клиент, так и сервер)
  • http://hub.docker.com есть репозиторий создан также (асамба/докер-кит).

/var/log / messages показывает 403, я не знаю, если это докер. Увидеть ниже.

любая помощь понятно, пожалуйста, дайте мне знать, если вам нужна дополнительная информация. Я сделал толчок с -f, а также. Не повезло!

17 ответов:

у меня тоже была такая же проблема.Вот как я это решаю.

Шаг 1: Войдите в Docker hub

Шаг 2: Создайте хранилище в докер-концентратор. скажем так:»mysqlserver: sql«.

Edit (13.08.2017)

на основе комментария @KaraPirinc, в docker версии 17 для входа в систему (Шаг 1),

решение, которое вы выложили не работает для меня.

это то, что работает для меня:

создать репозиторий с нужным именем.

при фиксации изображения, назовите изображение как репозиторий, включая имя пользователя /desired-name . Например, radu/desired-name .

ОК! ничего, я нашел решение. с 403 подозревается, что HTTP не идет на правильный URL.

измените файл, в котором хранятся учетные данные для входа

/.docker/config.json по умолчанию генерируется

to-обратите внимание на изменение от docker.io — > index.docker.io/v1 это и есть изменение.

надеюсь, что это поможет.

обратите внимание, что поле auth должно быть ‘username:password» base64 закодировано. например: «username: password» base64 encoded is » dXNlcm5hbWU6cGFzc3dvcmQ=»

так что ваш файл будет содержать:

я столкнулся с аналогичной проблемой с аналогичным бесполезным сообщением об ошибке, но это оказалось потому, что я пытался нажать образ, который я построил против управляемого экземпляра docker-machine.

когда я вошел в инстанс, это docker login и docker push все работало нормально.

У меня была та же проблема, но я исправил ее с помощью push с указанным url. как: docker login-u https://index.docker.io/v1/

хотя стандартный процесс состоит в том, чтобы войти в систему, а затем нажать на реестр docker, трюк, чтобы преодолеть эту конкретную проблему, — это войти, указав имя пользователя и пароль в одной строке.

работает

даже я вошел в систему и проверил все настройки, все равно ничего не получится .

оказалось, что когда я строю свой докер, я забываю поставить свое имя пользователя перед именем РЕПО

а потом, когда я нажал на мой репозиторий, я использовал

он покажет unauthorized authentication required

Итак, решение-это имя сборки, и толчок должен быть точно таким же

Если вы нажимаете новый личный образ в первый раз, убедитесь, что ваша подписка поддерживает этот дополнительный образ.

Docker позволяет вам иметь 6 частных изображений с именем, даже если вы платите только за 5, но не нажимаете на это 6-е изображение. Отсутствие информативного сообщения сбивает с толку и раздражает.

проблема новичков заключается в том, что мы склонны относиться к репозиторию Docker hub так же, как к репозиторию maven, и считаем, что он может содержать много разных файлов, папок и другого содержимого.

С другой стороны, репозиторий docker-это всего лишь одно изображение, оно не содержит ничего другого. Он может содержать разные версии одного и того же изображения, но его будет содержать только одно изображение.

Итак, назовите свой репозиторий на Docker hub тем же именем, что и изображение, которое вы хотите нажать в него и используйте свое имя пользователя dockerhub в качестве префикса. Например, если ваше имя пользователя имя_пользователя и Ваше имя изображение докер-кит, обязательно назовите свой репозиторий dockerhub как докер-кит и используйте следующие команды, чтобы пометить и отправить изображение в репозиторий:

что сработало для меня, так это создать новый репозиторий и переименовать изображение с помощью

$ docker tag image_id myname/server:latest

вот решение для моего случая (частные РЕПО, бесплатный план счета)

имя сборки изображения для нажатия должно иметь то же имя репозиториев.

пример: репозитории на Docker hub: accountName/resposName имя сборки образа «accountName / resposName» -> docker build-t accountName / resposName

введите docker push accountName / resposName: latest

убедитесь, что у вас есть больше слотов для личных изображений.

в моем случае я преобразовал пользователя в организацию, и он потерял один бесплатный частный образ, поэтому предыдущие толчки, которые работали, больше не работали.

убедитесь, что имя репозитория docker совпадает с именем локального репозитория docker. например, скажем, если вы локальное имя РЕПО «kavashgar / nodjsapp»

тогда у вас также должно быть имя РЕПО «кавашгар» в Docker hub

/.настройки/конфигурации.JSON и добавить

где XXXXX-это кодировка base64 вашего логин:пароль (В : входит) из https://hub.docker.com

в моем случае у меня была такая же ошибка с тяги. проблема (под windows) была спровоцирована двойным докером, запущенным процессом, поэтому убейте их всех и перезапустите одну службу, и она работает .

там уже были хорошие ответы, но я хотел бы упомянуть об одном — вам не нужно создавать репозиторий заранее, прежде чем нажимать его.

проблема для меня заключалась в том, что я не установил правильное имя пользователя учетной записи, в которую я вошел. Но как только правильное имя пользователя установлено перед изображением (например, YOURNAME/YOURIMAGE ) через его тег, вы можете нажать его, не создавая новый репозиторий заранее.

та же проблема здесь, во время нажатия изображения:

, который она напечатала:

—электронная почта является устаревшим (но войти удалось до сих пор)

решение: используйте последний синтаксис входа.

Он будет просить для обоих имя пользователя и пароль интерактивно. Тогда толчок изображения просто работает.

даже после используя новый синтаксис, my

/.docker/config.json выглядит так после входа в систему:

таким образом, учетные данные находятся в связке ключей macOS.

Я получил аналогичную ошибку для sudo docker push / sudo docker pull в репозитории ecr.Это связано с тем, что aws cli установлен в my user(abc) и docker установлен в root user.Я попытался запустить sudo docker push на моем пользователе (abc)

исправил это путем установки командной строки AWS в корень , настроить АРМ с помощью AWS настроить в корень и запустите sudo настройки Нажимаем на ККМ на корню

Источник

Skip to content



Open


Issue created Jul 23, 2016 by Crunchtime Ali@crunchtime-ali

unauthorized: authentication required on docker push to a different repo

I’m creating two docker images via gitlab-ci from one repository upon pushing them to GitLabs private container registry. The .gitlab-ci.yml is below.
myproject is the group name. backend and docs are GitLab projects within this group. Both have the container registry enabled.
build_image works OK but build_apidoc_image fails when pushing the image for the apidoc container to the registry with:

docker push myregistry.com/myproject/docs:latest
The push refers to a repository [myregistry.com/myproject/docs]
630816f32edb: Preparing
530d5553aec8: Preparing
c3f640b7175a: Preparing
378f94990a4e: Preparing
77b53f4affd3: Preparing
4b0bab9ff599: Preparing
d1c800db26c7: Preparing
42755cf4ee95: Preparing
4b0bab9ff599: Waiting
d1c800db26c7: Waiting
42755cf4ee95: Waiting
unauthorized: authentication required
ERROR: Build failed: exit code 1

The strange thing is that docker login succeeds:

$ docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN myregistry.com
Login Succeeded
$ docker build -t myregistry.com/myproject/docs -f apidoc/Dockerfile .
Sending build context to Docker daemon 485.4 kB

This gitlab build is triggered from the backend repository.
When building and pushing manually to docs it works.

Here’s the .gitlab-ci.yml

stages:
  - build

build_image:
  stage: build
  image: docker:git
  services:
    - docker:dind
  script:
    - docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN myregistry.com
    - docker build -t myregistry.com/myproject/backend .
    - docker push myregistry.com/myproject/backend:latest
  only:
    - master

build_apidoc_image:
  stage: build
  image: docker:git
  services:
    - docker:dind
  script:
    - docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN myregistry.com
    - docker build -t myregistry.com/myproject/docs -f apidoc/Dockerfile .
    - docker push myregistry.com/myproject/docs:latest

Edited Jul 15, 2020 by Jason Yavorska

Problem

After upgrading IBM Cloud Private to 3.1.1, the docker login command

docker login <cluster_CA_domain>:8500

fails with the following message after entering user and password:

Error response from daemon: Get https://<cluster_CA_domain>:8500/: unauthorized: authentication required

Before the upgrade, the docker login worked without problems.
All pods are also running correctly and there was no error during the upgrade.

Resolving The Problem

Different root causes could lead to this problem. Check below suggestions:

  1. Ensure that the authentication for the Docker CLI is configured correctly:
    https://www.ibm.com/support/knowledgecenter/en/SSBS6K_3.1.1/manage_images/configuring_docker_cli.html
  2. Review your Helm chart versions. If some have not been upgraded to 3.1.1, you might also see problems with the Docker login. You will not see any errors for not upgraded Helm charts during the upgrade itself.
    Either check the versions via the ICP UI > Workloads > Helm releases or via the command:

    helm list --tls

    If you see old releases re-run the upgrade again but delete the /.upgrade folder before:

    • cd /<new_installation_directory>/cluster 
    • sudo rm -rf .upgrade upgrade-version 
    • For Linux® 64-bit, run this command:
      sudo docker run -e LICENSE=accept --net=host --rm -t -v "$(pwd)":/installer/cluster ibmcom/icp-inception-amd64:3.1.1-ee upgrade-chart 

      For Linux® on Power® (ppc64le), run this command:

      sudo docker run -e LICENSE=accept --net=host --rm -t -v "$(pwd)":/installer/cluster ibmcom/icp-inception-ppc64le:3.1.1-ee upgrade-chart

    Afterwards, the Docker login should work again.

[{«Business Unit»:{«code»:»BU053″,»label»:»Cloud & Data Platform»},»Product»:{«code»:»SSBS6K»,»label»:»IBM Cloud Private»},»Component»:»»,»Platform»:[{«code»:»PF025″,»label»:»Platform Independent»}],»Version»:»3.1.1″,»Edition»:»»,»Line of Business»:{«code»:»LOB45″,»label»:»Automation»}}]

Понравилась статья? Поделить с друзьями:
  • Failed to execute script get как исправить
  • Failed to establish a connection unknown win32 error 10060
  • Failed to deploy vm postnfcdata failed io error
  • Failed to create d3d device please see the following for more info как исправить
  • Failed to create d3d device cs go как исправить windows 10