-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using Podman as docker substitute with terraform does not work as expected #20547
Comments
I suspect terraform is using API endpoint which is not correctly implemented in podman ( or shows inconsistent output as compared to docker ), running podman-server on debug mode can easily show which API is terraform trying to use for destroying container and we can match its consistancy with docker. Can you please show debug output of podman-server (service) ? OTOH off-topic there are also third-party dedicated podman providers for terraform. |
I attach log output of podman.socket service. To produce the log, I executed the following terraform commands: terraform init (no communication with podman I assume) |
Okay something is going off when terraform makes a DELETE request just after STOPPING a container ( i.e container is already removed by the STOP operation so DELETE fails) . I'll try to install terraform and reproduce this on my local and report back. |
I am able to reproduce but afaics the terraform provider attempting to perform |
Thanks for investigation. I will continue with this issue on the terraform docker provider as you suggested. |
One last comment. I found this issue on terraform docker provider: kreuzwerker/terraform-provider-docker#584 Could this be the root cause for this issue here? |
A friendly reminder that this issue had no activity for 30 days. |
Issue Description
I use the following Podman version on Linux Mint /Ubuntu based)
Client: Podman Engine
Version: 4.6.2
API Version: 4.6.2
Go Version: go1.18.1
Built: Thu Jan 1 01:00:00 1970
OS/Arch: linux/amd64
Podman can be activated via systemctl socket (unix:///run/user/1000/podman/podman.sock). This was tested with docker-compose.
Question: Is it a valid scenario to substitute docker with podman when using terrafom? If so, is the behavior I described an error or do I have to change any configuration settings in my environment?
Regards
Ulrich
Steps to reproduce the issue
See ecplanation
Describe the results you received
Now I want to use terraform with docker provider to handle some containers. For a 1st test I created a small terraform file to handle a NGINX Container
After putting this terraform file in an empty directory I execute the following terraform commands:
terraform init // Executed without error
terraform validate // No validation errors
terraform apply
I apply my changes and the NGINX container is executed. So far, so good. Executing "podman ps -a" shows:
If I now execute "terraform destroy" and confirm with "yes" I get the following error message:
The NGINX container is not longer running nor is it existing any more. "podman ps -a" shows an empty container list. But the NGINX container image is still there. "podman images shows"
If I now execute "terraform destroy" again, the image is also deleted.
Describe the results you expected
Container Image and Container itself could be managed using terraform and terraform docker provider.
podman info output
See explanation
Podman in a container
No
Privileged Or Rootless
Rootless
Upstream Latest Release
No
Additional environment details
Additional environment details
Additional information
Additional information like issue happens only occasionally or issue happens with a particular architecture or on a particular setting
The text was updated successfully, but these errors were encountered: