Skip to content

Conversation

suzuki-shunsuke
Copy link
Contributor

@saitho
Copy link

saitho commented Apr 24, 2021

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.

@suzuki-shunsuke
Copy link
Contributor Author

EDIT: I saw your comment, I guess that's the issue you described here:

Exactly.

@github-actions
Copy link

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.

@github-actions github-actions bot added the stale label Jun 24, 2021
@github-actions github-actions bot closed this Jul 1, 2021
@saitho
Copy link

saitho commented Jul 1, 2021

Can we reopen this?

@mavogel mavogel reopened this Jul 5, 2021
@mavogel mavogel added pinned and removed stale labels Jul 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants