docs: fix buildkit config documentation (#166)

This commit is contained in:
Robert Kaussow 2023-01-08 14:41:49 +01:00 committed by GitHub
parent 8ff3997363
commit f907bd038a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 17 additions and 5 deletions

View File

@ -9,7 +9,7 @@ config
dockerfile dockerfile
og og
gzip gzip
json toml
config config
host:ip host:ip
drone-docker-buildx drone-docker-buildx

View File

@ -72,7 +72,19 @@ properties:
required: false required: false
- name: buildkit_config - 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 type: string
defaultValue: false defaultValue: false
required: false required: false

View File

@ -109,7 +109,7 @@ func settingsFlags(settings *plugin.Settings, category string) []cli.Flag {
&cli.StringFlag{ &cli.StringFlag{
Name: "daemon.buildkit-config", Name: "daemon.buildkit-config",
EnvVars: []string{"PLUGIN_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, Destination: &settings.Daemon.BuildkitConfig,
Category: category, Category: category,
}, },

View File

@ -9,7 +9,7 @@ const (
dockerExe = "/usr/local/bin/docker" dockerExe = "/usr/local/bin/docker"
dockerdExe = "/usr/local/bin/dockerd" dockerdExe = "/usr/local/bin/dockerd"
dockerHome = "/root/.docker/" dockerHome = "/root/.docker/"
buildkitConfig = "/tmp/buildkit.json" buildkitConfig = "/tmp/buildkit.toml"
) )
func (p Plugin) startDaemon() { func (p Plugin) startDaemon() {

View File

@ -146,7 +146,7 @@ func (p *Plugin) Execute() error {
if p.settings.Daemon.BuildkitConfig != "" { if p.settings.Daemon.BuildkitConfig != "" {
err := os.WriteFile(buildkitConfig, []byte(p.settings.Daemon.BuildkitConfig), 0o600) err := os.WriteFile(buildkitConfig, []byte(p.settings.Daemon.BuildkitConfig), 0o600)
if err != nil { if err != nil {
return fmt.Errorf("error writing buildkit.json: %s", err) return fmt.Errorf("error writing buildkit.toml: %s", err)
} }
} }