diff --git a/Docker/buildx.yml b/Docker/buildx.yml new file mode 100644 index 0000000..48972d6 --- /dev/null +++ b/Docker/buildx.yml @@ -0,0 +1,41 @@ +# Build and publish Docker images for multible architectures. +# +# Pushing an image to codeberg as container registry, +# package owner will be the repo owner. +# +# this config also shows usage of yaml aliases and +# was taken from https://codeberg.org/6543/docker-images/src/commit/37e29c227717c1c07d2776cddcf14725bf952875/.woodpecker/hello.yml + +branches: main + +variables: + - &file Dockerfile.hello + - &repo codeberg.org/${CI_REPO_OWNER}/hello + +pipeline: + dryrun: + image: woodpeckerci/plugin-docker-buildx + settings: + dockerfile: *file + platforms: linux/arm/v7,linux/arm64/v8,linux/amd64,linux/ppc64le + dry_run: true + repo: *repo + tags: latest + when: + event: pull_request + path: *file + + publish: + image: woodpeckerci/plugin-docker-buildx + settings: + dockerfile: *file + platforms: linux/arm/v7,linux/arm64/v8,linux/amd64,linux/ppc64le + repo: *repo + registry: codeberg.org + tags: latest + username: ${CI_REPO_OWNER} + password: + from_secret: cb_token + when: + event: push + path: *file diff --git a/README.md b/README.md index d2e710e..2699df2 100644 --- a/README.md +++ b/README.md @@ -12,9 +12,11 @@ Pull requests are accepted/welcome. | [golang/build-docker.yml](golang/build-docker.yml) | golang | golang / kaniko | CI to build golang project and build various docker container and publish them on DockerHub | | [Jekyll/jekyll.yml](Jekyll/jekyll.yml) | Markdown | Jekyll | CI step to build static website files and publish them to Codeberg Pages using Jekyll | | [Hugo/hugo.yml](Hugo/hugo.yml) | Markdown | Hugo | CI step to build static website files and publish them to Codeberg Pages with Hugo | -| [Docker/docker.yml](Docker/kaniko.yml) | Dockerfile | [Kaniko][1] | Minimalistic CI pipeline with clear instructions to push a Docker image | +| [Docker/kaniko.yml](Docker/kaniko.yml) | Dockerfile | [Kaniko][1] | Minimalistic CI pipeline with clear instructions to push a Docker image | +| [Docker/buildx.yml](Docker/buildx.yml) | Dockerfile | [buildx][2] | Build and publish Docker images for multible architectures on codeberg | # More: https://codeberg.org/explore/repos?q=woodpecker-ci&topic=1 [1]: https://github.com/GoogleContainerTools/kaniko +[2]: https://codeberg.org/woodpecker-plugins/plugin-docker-buildx