Replies: 4 comments 1 reply
-
Maybe the documentation can help you: Docker Documentation. I apologize for any shortcomings in my English proficiency.🥲 |
Beta Was this translation helpful? Give feedback.
-
This question looks to be better for the BuildKit issue tracker, or perhaps better as a discussion there; let me transfer this ticket, and convert it, but I'll add some pointers after that. |
Beta Was this translation helpful? Give feedback.
-
It's difficult to provide a "full" answer, as some of this may highly depend on your situation, but here's some pointers; First of all;
One alternative is also to consider vendoring your dependencies (which is what the BuildKit repository does); but this is not a "one-size fits all" solution, and may depend on your situation. Vendoring the dependencies will allow you to handle fetching the dependencies ahead of time (so the Dockerfile may not need access to credentials when building), and can allows for building your Dockerfile in air-gapped / offline situations (it also may allow easier reviewing of changes in dependencies, and makes sure you can continue building even if a dependency module may disappear (go module's caching proxy does not protect against that)). Vendoring will add additional bloat to your code-repository though, and there may be some additional complexity involved (such as verifying the vendored dependencies, and updating them), so this solution may not be "for everyting". On the documentation side; I notice that the "build overview" page has no tile for "secrets", and that neither the /cc @dvdksn |
Beta Was this translation helpful? Give feedback.
-
I recently added an example of using private Go modules to build with GitHub Actions, see here: https://docs.docker.com/build/ci/github-actions/secrets/#ssh-mounts |
Beta Was this translation helpful? Give feedback.
-
Description
how to ues dockerfile build go project when go import private pkg
Beta Was this translation helpful? Give feedback.
All reactions