[DX-3066] Don't skip private plugins when building the image#2458
[DX-3066] Don't skip private plugins when building the image#2458
Conversation
|
👋 Tofel, thanks for creating this pull request! To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team. Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks! |
There was a problem hiding this comment.
Pull request overview
Updates local Docker image build behavior to stop forcibly disabling installation of private plugins, and adds optional GitHub token plumbing intended to support authenticated fetches during the Docker build.
Changes:
- Removes the hard-coded
CL_INSTALL_PRIVATE_PLUGINS=falsebuild-arg fromdocker buildinvocations. - If
GITHUB_TOKENis set, appends adocker build --secret id=GIT_AUTH_TOKEN,env=GITHUB_TOKENoption (both DLV and non-DLV paths).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if os.Getenv("GITHUB_TOKEN") != "" { | ||
| commandParts = append(commandParts, "--secret", "id=GIT_AUTH_TOKEN,env=GITHUB_TOKEN") | ||
| } |
There was a problem hiding this comment.
docker build --secret ... requires BuildKit; on environments where BuildKit isn't the default, this will fail with "unknown flag: --secret" whenever GITHUB_TOKEN is set (e.g., GitHub Actions). Consider explicitly enabling BuildKit for this invocation (e.g., setting DOCKER_BUILDKIT=1 on the exec.Cmd env) or using a BuildKit-aware builder (docker buildx build), and/or gating --secret behind a BuildKit check.
| if os.Getenv("GITHUB_TOKEN") != "" { | ||
| commandParts = append(commandParts, "--secret", "id=GIT_AUTH_TOKEN,env=GITHUB_TOKEN") | ||
| } |
There was a problem hiding this comment.
Same issue as above: adding --secret will break builds on hosts where BuildKit isn't enabled by default. Prefer explicitly enabling BuildKit for this build command or using a BuildKit builder before appending --secret.
This pull request updates the Docker image build process to use Docker Buildx instead of the standard Docker build command, and removes the explicit setting of the
CL_INSTALL_PRIVATE_PLUGINSenvironment variable tofalse. It also adds support for passing a GitHub token as a build secret if available.Docker build process improvements:
docker buildtodocker buildx buildfor building images, enabling advanced build features and better cross-platform support.CL_INSTALL_PRIVATE_PLUGINS=falsebuild argument, so it is no longer set by default during image builds. [1] [2]GITHUB_TOKENas a build secret (--secret id=GIT_AUTH_TOKEN,env=GITHUB_TOKEN) if the environment variable is set, improving access to private repositories during the build.Documentation:
CL_INSTALL_PRIVATE_PLUGINSvariable and the switch to Buildx for Docker image builds.