how to push a Docker image (#6)

Without needing access to the Docker daemon ie. exposing `docker.sock`

Co-authored-by: Daniel-Andrei Minca <catalogue-candle.0j@icloud.com>
Reviewed-on: https://codeberg.org/Codeberg-CI/examples/pulls/6
Co-authored-by: Solinvictus <catalogue-candle.0j@icloud.com>
Co-committed-by: Solinvictus <catalogue-candle.0j@icloud.com>
This commit is contained in:
Solinvictus 2022-08-08 16:31:01 +02:00 committed by 6543
parent 5795374dc9
commit 0f1fb2dbdb
2 changed files with 19 additions and 0 deletions

16
Docker/kaniko.yml Normal file
View File

@ -0,0 +1,16 @@
# Pushes a Docker image without needing access to the Docker daemon
#
# Pushing an image to a container registry authenticated:
# DOCKER_USERNAME - Woodpecker CI Secret which is the container registry username
# DOCKER_PASSWORD - Woodpecker CI Secret which is container registry password
pipeline:
publish-docker-image:
image: plugins/kaniko
settings:
repo: sample/image
tags: latest,v1-${CI_COMMIT_SHA:0:8}
dockerfile: Dockerfile
username:
from_secret: docker_username
password:
from_secret: docker_password

View File

@ -12,6 +12,9 @@ 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 |
# More:
https://codeberg.org/explore/repos?q=woodpecker-ci&topic=1
[1]: https://github.com/GoogleContainerTools/kaniko