diff --git a/framework/.changeset/v0.15.2.md b/framework/.changeset/v0.15.2.md new file mode 100644 index 000000000..76410ae45 --- /dev/null +++ b/framework/.changeset/v0.15.2.md @@ -0,0 +1,2 @@ +- Don't set `CL_INSTALL_PRIVATE_PLUGINS` env var to `false` when building Docker images +- Build docker images with buildx diff --git a/framework/docker.go b/framework/docker.go index 46bc3c47c..5e2f3d99a 100644 --- a/framework/docker.go +++ b/framework/docker.go @@ -418,18 +418,25 @@ func BuildImageOnce(once *sync.Once, dctx, dfile, nameAndTag string, buildArgs m func BuildImage(dctx, dfile, nameAndTag string, buildArgs map[string]string) error { dfilePath := filepath.Join(dctx, dfile) + if os.Getenv("CTF_CLNODE_DLV") == "true" { - commandParts := []string{"docker", "build", "--build-arg", `GO_GCFLAGS=all=-N -l`, "--build-arg", "CHAINLINK_USER=chainlink", "--build-arg", "CL_INSTALL_PRIVATE_PLUGINS=false"} + commandParts := []string{"docker", "buildx", "build", "--build-arg", `GO_GCFLAGS=all=-N -l`, "--build-arg", "CHAINLINK_USER=chainlink"} for k, v := range buildArgs { commandParts = append(commandParts, "--build-arg", fmt.Sprintf("%s=%s", k, v)) } + if os.Getenv("GITHUB_TOKEN") != "" { + commandParts = append(commandParts, "--secret", "id=GIT_AUTH_TOKEN,env=GITHUB_TOKEN") + } commandParts = append(commandParts, "-t", nameAndTag, "-f", dfilePath, dctx) return RunCommand(commandParts[0], commandParts[1:]...) } - commandParts := []string{"docker", "build", "--build-arg", "CHAINLINK_USER=chainlink", "--build-arg", "CL_INSTALL_PRIVATE_PLUGINS=false"} + commandParts := []string{"docker", "buildx", "build", "--build-arg", "CHAINLINK_USER=chainlink"} for k, v := range buildArgs { commandParts = append(commandParts, "--build-arg", fmt.Sprintf("%s=%s", k, v)) } + if os.Getenv("GITHUB_TOKEN") != "" { + commandParts = append(commandParts, "--secret", "id=GIT_AUTH_TOKEN,env=GITHUB_TOKEN") + } commandParts = append(commandParts, "-t", nameAndTag, "-f", dfilePath, dctx) return RunCommand(commandParts[0], commandParts[1:]...) }