From f907bd038ad6e9f6b0c1d99d0b71e2c26835fd79 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Sun, 8 Jan 2023 14:41:49 +0100 Subject: [PATCH] docs: fix buildkit config documentation (#166) --- .dictionary | 2 +- _docs/data/data.yaml | 14 +++++++++++++- cmd/drone-docker-buildx/config.go | 2 +- plugin/daemon.go | 2 +- plugin/impl.go | 2 +- 5 files changed, 17 insertions(+), 5 deletions(-) diff --git a/.dictionary b/.dictionary index 869711b..314721b 100644 --- a/.dictionary +++ b/.dictionary @@ -9,7 +9,7 @@ config dockerfile og gzip -json +toml config host:ip drone-docker-buildx diff --git a/_docs/data/data.yaml b/_docs/data/data.yaml index 40979a3..3d4b8ef 100644 --- a/_docs/data/data.yaml +++ b/_docs/data/data.yaml @@ -72,7 +72,19 @@ properties: required: false - name: buildkit_config - description: Content of the docker buildkit json config. + description: | + Content of the docker buildkit toml [config](https://github.com/moby/buildkit/blob/master/docs/buildkitd.toml.md). Example: + + ```TOML + - name: Build + image: thegeeklab/drone-docker-buildx:20 + settings: + repo: example/repo + buildkit_config: | + [registry."registry.local:30081"] + http = true + insecure = true + ``` type: string defaultValue: false required: false diff --git a/cmd/drone-docker-buildx/config.go b/cmd/drone-docker-buildx/config.go index 3bb8b49..c51f39e 100644 --- a/cmd/drone-docker-buildx/config.go +++ b/cmd/drone-docker-buildx/config.go @@ -109,7 +109,7 @@ func settingsFlags(settings *plugin.Settings, category string) []cli.Flag { &cli.StringFlag{ Name: "daemon.buildkit-config", EnvVars: []string{"PLUGIN_BUILDKIT_CONFIG"}, - Usage: "content of the docker buildkit json config", + Usage: "content of the docker buildkit toml config", Destination: &settings.Daemon.BuildkitConfig, Category: category, }, diff --git a/plugin/daemon.go b/plugin/daemon.go index 8638691..2cd0dce 100644 --- a/plugin/daemon.go +++ b/plugin/daemon.go @@ -9,7 +9,7 @@ const ( dockerExe = "/usr/local/bin/docker" dockerdExe = "/usr/local/bin/dockerd" dockerHome = "/root/.docker/" - buildkitConfig = "/tmp/buildkit.json" + buildkitConfig = "/tmp/buildkit.toml" ) func (p Plugin) startDaemon() { diff --git a/plugin/impl.go b/plugin/impl.go index 3e39085..cfd826a 100644 --- a/plugin/impl.go +++ b/plugin/impl.go @@ -146,7 +146,7 @@ func (p *Plugin) Execute() error { if p.settings.Daemon.BuildkitConfig != "" { err := os.WriteFile(buildkitConfig, []byte(p.settings.Daemon.BuildkitConfig), 0o600) if err != nil { - return fmt.Errorf("error writing buildkit.json: %s", err) + return fmt.Errorf("error writing buildkit.toml: %s", err) } }