Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow adding arbitrary buildkit config #121

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@ _(As a convention in the list below, all task parameters are specified with a
(`,`) list of key-value pairs (using syntax `hostname=ip-address`), each
defining an IP address for resolving some custom hostname.

* `$BUILDKIT_EXTRA_CONFIG` (default empty): a string written verbatim to builkit's
TOML config file. See [buildkitd.toml](https://docs.docker.com/build/buildkit/toml-configuration/).

> Note: this is the main pain point with reusable tasks - env vars are kind of
> an awkward way to configure a task. Once the RFC lands these will turn into a
> JSON structure similar to configuring `params` on a resource, and task params
Expand Down
7 changes: 7 additions & 0 deletions buildkitd.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,13 @@ func generateConfig(req Request, configPath string) error {
return err
}

if len(req.Config.BuildkitExtraConfig) > 0 {
_, err = f.WriteString(req.Config.BuildkitExtraConfig)
if err != nil {
return err
}
}

return f.Close()
}

Expand Down
2 changes: 2 additions & 0 deletions types.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ type Config struct {

BuildkitSecrets map[string]string `json:"buildkit_secrets" envconfig:"optional"`

BuildkitExtraConfig string `json:"buildkit_extra_config" envconfig:"BUILDKIT_EXTRA_CONFIG,optional"`

// Unpack the OCI image into Concourse's rootfs/ + metadata.json image scheme.
//
// Theoretically this would go away if/when we standardize on OCI.
Expand Down