unauthorized: access to the requested resource is not authorized
kangqing opened this issue · comments
Terraform Version
Terraform v1.8.5
on darwin_arm64
Terraform Configuration Files
terraform {
required_providers {
docker = {
source = "kreuzwerker/docker"
version = "~> 3.0.1"
}
}
}
resource "docker_image" "demo_terraform" {
name = var.image_name
keep_locally = false
}
variable "image_name" {
description = "Value of the name for the Docker container"
type = string
default = "192.168.1.106:8083/repository/docker-nexus/demo-terraform:0.0.1-SNAPSHOT"
}
Debug Output
│ Error: Unable to read Docker image into resource: unable to pull image 192.168.1.106:8083/repository/docker-nexus/demo-terraform:0.0.1-SNAPSHOT: error pulling image 192.168.1.106:8083/repository/docker-nexus/demo-terraform:0.0.1-SNAPSHOT: Error response from daemon: Head "http://192.168.1.106:8083/v2/repository/docker-nexus/demo-terraform/manifests/0.0.1-SNAPSHOT": unauthorized: access to the requested resource is not authorized
│
│ with module.terraform_container_debian.docker_image.demo_terraform,
│ on test_container/main.tf line 10, in resource "docker_image" "demo_terraform":
│ 10: resource "docker_image" "demo_terraform" {
Expected Behavior
I cannot pull Docker images from my Nexus3 private server,
I can pull it on the target host using the Docker pull command
Even the following configurations can be pulled
provisioner "remote-exec" {
inline = [
"sudo docker pull your_docker_image",
"docker ps"
]
}
error:
unauthorized: access to the requested resource is not authorized
How can I authenticate Nexus private server to pull Docker images?
Actual Behavior
error:
unauthorized: access to the requested resource is not authorized
Steps to Reproduce
terraform apply
Additional Context
No response
References
No response
Hello,
This appears to be a question or an issue with a provider, not with Terraform itself. You can check existing issues and file a new one in the provider's project repository, linked from the their registry page. If you have questions about Terraform or the provider, it's better to use the community forum where there are more people ready to help. The GitHub issues here are monitored only by a few core maintainers.
Thanks!