terraform-provider-docker
terraform-provider-docker copied to clipboard
fix: change docker_image.pull_triggers's ForceNew to false
#172
https://github.com/kreuzwerker/terraform-provider-docker/pull/178#issuecomment-826062175
I just tried that change. I needed to apply twice to get the expected result. The first apply only updates the docker_image. The second apply is needed to also recreate the container with the new image.
mario@mario-XPS-13-9370:~/Workspace/terraform-provider-docker/testing$ terraform apply -auto-approve docker_image.test: Refreshing state... [id=sha256:1a95aff9415c6456a4db6250882336a52ccab79817d499b7f455cdf96c8cc18dsaitho/test:latest] docker_container.test: Refreshing state... [id=0e33f61b2e0d331fd05eb343420842aabf632a008930e5dbc52899bcbd7a89c7] docker_image.test: Modifying... [id=sha256:1a95aff9415c6456a4db6250882336a52ccab79817d499b7f455cdf96c8cc18dsaitho/test:latest] docker_image.test: Modifications complete after 3s [id=sha256:1198440a57c639be59041d73ed553cd2698153ee5d4c0e83dba56332ef59f10csaitho/test:latest]
Apply complete! Resources: 0 added, 1 changed, 0 destroyed. mario@mario-XPS-13-9370:~/Workspace/terraform-provider-docker/testing$ terraform apply -auto-approve docker_image.test: Refreshing state... [id=sha256:1198440a57c639be59041d73ed553cd2698153ee5d4c0e83dba56332ef59f10csaitho/test:latest] docker_container.test: Refreshing state... [id=0e33f61b2e0d331fd05eb343420842aabf632a008930e5dbc52899bcbd7a89c7] docker_container.test: Destroying... [id=0e33f61b2e0d331fd05eb343420842aabf632a008930e5dbc52899bcbd7a89c7] docker_container.test: Destruction complete after 1s docker_container.test: Creating... docker_container.test: Creation complete after 0s [id=6c48a98aa7e860a583e2fd1e5725ec2ab3153c346b1e364f7ad8e21d087ac043]
Apply complete! Resources: 1 added, 0 changed, 1 destroyed.
EDIT: I saw your comment, I guess that's the issue you described here:
When terraform plan is run, even if a docker_image resource is updated, the dependent docker_container resource isn't updated. I guess the cause is Computed of docker_image.latest is true.
EDIT: I saw your comment, I guess that's the issue you described here:
Exactly.
This pull request is stale because it has been open 60 days with no activity.
Remove stale label or comment or this will be closed in 7 days.
If you don't want this pull request to be closed, please set the label pinned.
Can we reopen this?