terraform-provider-docker
terraform-provider-docker copied to clipboard
consider reusing code from docker/cli
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
By the time logic has been copied and reused from the docker/cli. As we import this package we should see what code we can reuse.
New or Affected Resource(s)
- docker_*
References
- #94
- #240
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.
@mavogel What about reusing buildx #417 for the builds as well ?
We are always trying to re-use as much code from docker/cli or moby/moby.
The challenge is, that our interface is a lot different to the one of the docker cli.
So, the docker cli has some code to basically convert all options/flags, gather files and so on and then calls e.g. client.ImageBuild.
Inside the docker provider we also eventually call client.ImageBuild but since we have a different interface, we often have do copy code from the docker cli in order to implement the same functionality.
And often the function/code is not exported by the go module, so even if we wanted, we cannot use it...
In general, it is always a case-by-case decision and one has to take a deep look into the existing docker codebase.