terraform-provider-docker icon indicating copy to clipboard operation
terraform-provider-docker copied to clipboard

feat: Support podman

Open Junkern opened this issue 2 years ago • 0 comments

This will be an ongoing PR to be able to at least unofficially support podman, so that we can close https://github.com/kreuzwerker/terraform-provider-docker/issues/113

The goal is to be able to run the whole test suite locally (maybe in the future also have the test suit running here in Github)

Current steps:

  • Use this PR as the baseline
  • Init podman machine with the correct volume: podman machine init -v "$(pwd)"/scripts/testing:/mnt/testing
  • spin up the testing infrastructure ./scripts/testacc_setup.sh
  • Run some tests: DOCKER_HOST=unix:///Users/username/.local/share/containers/podman/machine/podman-machine-default/podman.sock TF_LOG=DEBUG TF_ACC=1 go test -v ./internal/provider -timeout 360s -run TestAccDockerContainer

Issues:

  • [x] ~~Podman complains about our self-signed certificates for our local registries x509: certificate relies on legacy Common Name field, use SANs instead~~ We created a registries.conf inside the podman VM to "whitelist" our insecure registry (see for exact commands https://gist.github.com/doytsujin/836701deb5e5521712628e575ea22c64)

Test Suite:

  • [x] ~~TestAccDockerConfig~~: Apparently the service is not supported by podman: Podman does not support service: /v1.41/configs/create
  • [ ] TestAccDockerContainer Many failing tests, often due to the same error as above
  • [ ] TestAccDockerImage One failing test: TestAccDockerImage_name_attr_change due to force replacements of network_mode and pid_mode
  • [ ] TestAccDockerNetwork Number of different errors
  • [x] ~~TestAccDockerPlugin~~: It seems to me that docker plugins are not supported in podman
  • [ ] TestAccDockerRegistryImage Some working tests, but many tests fail due to Bad Request for API route and version, e.g. TestAccDockerRegistryImageResource_whitelistDockerignore
  • [x] TestAccDockerSecret: All tests pass
  • [x] ~~TestAccDockerService~~: Seems not to be supported by Podman: Podman does not support service: /v1.41/services/create
  • [x] TestAccDockerVolume: All tests pass
  • [ ] TestAccDockerTag One failing test: TestAccDockerTag_no_local_image

Junkern avatar Dec 22 '22 16:12 Junkern