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

consider reusing code from docker/cli

Open mavogel opened this issue 4 years ago • 2 comments

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

mavogel avatar Mar 19 '21 07:03 mavogel

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.

github-actions[bot] avatar May 18 '21 10:05 github-actions[bot]

@mavogel What about reusing buildx #417 for the builds as well ?

yuriy-yarosh avatar Jul 30 '22 12:07 yuriy-yarosh

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.

Junkern avatar Jan 05 '23 12:01 Junkern