terraform-provider-docker
terraform-provider-docker copied to clipboard
Support for Podman
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
Description
Since Podman v2.0.0, a REST API is available and support Docker API v1.40 (https://podman.io/blogs/2020/07/01/rest-versioning.html). I tried it with this provider and some stuffs works, other don't. I'm wondering if we could support more stuffs. First step would be to make acceptance tests run with the Podman API:
sudo DOCKER_HOST=unix:///run/podman/podman.sock make testacc
or in root-less mode:
DOCKER_HOST=unix:///run/user/1000/podman/podman.sock make testacc
References
- https://podman.io/blogs/2020/07/01/rest-versioning.html
This issue 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 issue to be closed, please set the label pinned
.
This issue 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 issue to be closed, please set the label pinned
.
I don't have any experience with Podman. I installed it on my M1 Mac, tried to run the tests with it and it complained with issues about volumes and such. It would be great of someone from the community would take this over and drive this topic!
It works for me. 😄
- Find out the podman socket
$ podman machine inspect| jq ".[].ConnectionInfo.PodmanSocket.Path"
"/Users/jamie/.local/share/containers/podman/machine/podman-machine-default/podman.sock"
- Terraform block
terraform {
required_providers {
docker = {
source = "kreuzwerker/docker"
version = "~>2.22.0"
}
}
}
- Provider block
provider "docker" {
host = "unix:///Users/jamie/.local/share/containers/podman/machine/podman-machine-default/podman.sock"
}
That's great! Are you able to run the tests as mentioned in https://github.com/kreuzwerker/terraform-provider-docker/blob/master/CONTRIBUTING.md ?
No, I think I couldn't.
I've tried run go test -v -count=1 -race ./...
after alias docker="podman"
.
It failed in:
https://github.com/kreuzwerker/terraform-provider-docker/blob/0588c2071bbe77459e4b7e4cee7e6c050ba499a5/internal/provider/data_source_docker_plugin_test.go#L13
But it's still an awesome terraform provider to me. I can finish the tutorial Build Infrastructure - Terraform Docker Example via podman
instead of docker
.
I started some work in https://github.com/kreuzwerker/terraform-provider-docker/pull/495 Edit: Got it to work ~~If anyone could support in getting the self-signed certificates to work, that would be amazing!~~