terraform-provider-docker
terraform-provider-docker copied to clipboard
Cannot push on registry with auth disabled
Community Note
- Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
- Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
- If you are interested in working on this issue or have submitted a pull request, please leave a comment
Terraform (and docker Provider) Version
v1.3.1
Affected Resource(s)
docker_registry_image
Terraform Configuration Files
provider "docker" {
host = "unix:///var/run/docker.sock"
registry_auth {
address = var.docker_registry
}
}
resource "docker_image" "public_docker_image" {
name = "public_docker_image:tag"
}
resource "docker_tag" "my_private_docker_image_tag" {
depends_on = [
docker_image.public_docker_image
]
source_image = docker_image.public_docker_image.name
target_image = "${var.docker_registry}/${docker_image.public_docker_image.name}"
}
resource "docker_registry_image" "my_private_docker_image" {
depends_on = [
docker_tag.my_private_docker_image_tag
]
name = "${var.docker_registry}/${docker_image.public_docker_image.name}"
}
Expected Behaviour
When using docker push my_private_docker_image on a private registry with auth disabled, push succeed without specifying anything.
Actual Behaviour
It prompt an error:
Error: Error pushing docker image: Error response from daemon: Bad parameters and missing X-Registry-Auth: EOF
I've also try to add empty username and password on the registry_auth block and it doesn't work either.
Steps to Reproduce
- choose a public image
- start a private registry
terraform apply