Skip to content
This repository has been archived by the owner on Aug 21, 2022. It is now read-only.

Auto-updating Docker images (from private registries) not working #18

Open
saitho opened this issue Mar 27, 2021 · 1 comment
Open

Auto-updating Docker images (from private registries) not working #18

saitho opened this issue Mar 27, 2021 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@saitho
Copy link
Member

saitho commented Mar 27, 2021

By running terraform apply periodically it should pull new containers when they are available and the "latest" tag is used.
It should then start up the new containers and update the webserver configuration (port numbers).
Then the new application should be served.

There seem to be issues, at least with private registries. After pushing a new "latest" image to the registry, terraform apply will do something, but not pull the new image? I have to run docker pull manually and then terraform apply again, to get the latest image running.

How to reproduce

I want to get the latest image of "myregistry.com:6443/myimage:latest"

docker_container

~ image = "sha256:8d8adb0c6006bb896796554e8e6220c5b394f542552097205249a743a2af319e" -> (known after apply) # forces replacement

docker_image

~ pull_triggers = [ # forces replacement
- "sha256:2dab7d4ae4052603c972c497feaaadda2ba11091f9bcd084e8600d4e0c3bfacb",
+ "sha256:f203c08336d066723f505eed25232df65d82ac9e897bc468c98aeeb16f8769d9",
]

New image hash is correct. Running docker images will yield:

myregistry.com:6443/myimage    latest       8d8adb0c6006   2 days ago     44.8MB
myregistry.com:6443/myimage <none>       5325c84777ec   2 days ago     44.8MB

Then I pull the image manually and run docker images:

docker.saitho.me:6443/simuldub_de/hugo   latest       35b55c54f1d8   10 minutes ago   45.7MB
docker.saitho.me:6443/simuldub_de/hugo   <none>       8d8adb0c6006   2 days ago       44.8MB
docker.saitho.me:6443/simuldub_de/hugo   <none>       5325c84777ec   2 days ago       44.8MB

The image is downloaded correctly. Running terraform apply again will recreate the containers and provide the latest version of the application.

@saitho saitho added the bug Something isn't working label Mar 27, 2021
@saitho saitho self-assigned this Mar 27, 2021
@saitho saitho changed the title Auto-updating Docker images from private registries Auto-updating Docker images (from private registries) not working Mar 27, 2021
@saitho
Copy link
Member Author

saitho commented Apr 10, 2021

The issue is not limited to private registries. Reproduced on a new server with latest Terraform version.
Reported here: kreuzwerker/terraform-provider-docker#172

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant