adds driver-opt arg as plugin parameter (#93)

#### 📖 Summary

Adds `--driver-opt` buildx arg as plugin parameter. This should make it possible to pass through proxy settings.

#### 📑 Test Plan

> 💡 Select your test plan for the code changes.

-  [x] CI pipeline tests
- Custom test
-  No test plan

##### Details / Justification

Manually tested on own instance behind corporate proxy:

![image](/attachments/b65d981d-c9b8-4228-8e9c-61fa517d98b6)

Unfortunately  the `--build-arg` passthru seems not working

#### 📚 Additional Notes

- fixes #82
- still to do:
  - [x] update docs
  - [x] add usage example

> 💡NOTE: This is my first contribution in this codebase. Feedback and help is probably needed 😸

Reviewed-on: https://codeberg.org/woodpecker-plugins/docker-buildx/pulls/93
Reviewed-by: Patrick Schratz <pat-s@noreply.codeberg.org>
Co-authored-by: OCram85 <marco.blessing@googlemail.com>
Co-committed-by: OCram85 <marco.blessing@googlemail.com>
This commit is contained in:
OCram85
2023-10-25 09:58:02 +00:00
committed by Patrick Schratz
parent c8fa946f16
commit a0371f8850
5 changed files with 150 additions and 14 deletions

View File

@@ -99,6 +99,12 @@ func settingsFlags(settings *plugin.Settings) []cli.Flag {
Usage: "sets content of the docker buildkit json config",
Destination: &settings.Daemon.BuildkitConfig,
},
&cli.StringSliceFlag{
Name: "daemon.buildkit-driveropt",
EnvVars: []string{"PLUGIN_BUILDKIT_DRIVEROPT"},
Usage: "adds optional driver-ops args like 'env.http_proxy'",
Destination: &settings.Daemon.BuildkitDriverOpt,
},
&cli.StringFlag{
Name: "dockerfile",
EnvVars: []string{"PLUGIN_DOCKERFILE"},