docker-buildx/go.mod
pat-s e93554e4bc feat: add support for AWS ECR (#110)
fix #74

Mainly borrowed from https://github.com/drone-plugins/drone-docker/tree/master/cmd/drone-ecr.

`drone/ecr` is still on 20.10.14 and sparsely updated/maintained. Would be great to add support for additional registries like ECR to buildx.
The login process is as follows:

1. Call the AWS API with some arguments to get a short-lived auth token (12h)
2. Use the token and Username `AWS` for the `docker login` call

## Notes

- To push to ECR, the full registry URL must be given in the tag, i.e. `registry/owner/repo`. For this, `Registry` must also be added the to `Build` struct besides the `Settings` struct
- For now I've only referenced the source in `ecr.go` by using the most recent commit of today. Should this be done differently?
- The implementation here from me is simple and probably a bit "naive" as this is my first "real" golang feature PR.
- I've tested this change with a custom image and was able to successfully push to ECR while dynamically creating a repository. Proper tests would still be great...
- Vars `assumeRole` and `externalID` are somehow not exposed in https://plugins.drone.io/plugins/ecr and I am not sure if this is by design or because they were just forgotten. Anyhow, this is reason I didn't expose them for now and just added internal dummy vars.
Co-authored-by: pat-s <patrick.schratz@gmail.com>
Co-committed-by: pat-s <patrick.schratz@gmail.com>
2023-12-29 22:06:37 +00:00

32 lines
1.1 KiB
Modula-2

module codeberg.org/woodpecker-plugins/plugin-docker-buildx
go 1.20
require (
codeberg.org/6543/go-yaml2json v1.0.0
github.com/6543/go-version v1.3.1
github.com/aws/aws-sdk-go v1.47.4
github.com/drone-plugins/drone-plugin-lib v0.4.2
github.com/joho/godotenv v1.5.1
github.com/sirupsen/logrus v1.9.3
github.com/stretchr/testify v1.8.4
github.com/urfave/cli/v2 v2.27.0
golang.org/x/lint v0.0.0-20210508222113-6edffad5e616
honnef.co/go/tools v0.4.6
)
require (
github.com/BurntSushi/toml v1.3.2 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
golang.org/x/exp/typeparams v0.0.0-20221208152030-732eee02a75a // indirect
golang.org/x/mod v0.12.0 // indirect
golang.org/x/sys v0.12.0 // indirect
golang.org/x/tools v0.12.1-0.20230825192346-2191a27a6dc5 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)