feat(ci): migrate to buildah
This commit is contained in:
parent
23ccf2bead
commit
8ccd5dc3ec
1 changed files with 12 additions and 18 deletions
|
|
@ -1,32 +1,26 @@
|
|||
---
|
||||
|
||||
variables:
|
||||
DOCKER_DRIVER: "overlay2"
|
||||
DOCKER_HOST: "tcp://localhost:2375/"
|
||||
DOCKER_TLS_CERTDIR: ""
|
||||
STORAGE_DRIVER: "overlay"
|
||||
|
||||
stages:
|
||||
- "build"
|
||||
|
||||
image-build:
|
||||
stage: "image-build"
|
||||
image: "docker:28.2.2"
|
||||
services:
|
||||
- name: "docker:28.2.2-dind"
|
||||
command: ["--tls=false"]
|
||||
image: "quay.io/buildah/stable:latest"
|
||||
script:
|
||||
|
||||
# login to container registry
|
||||
- "echo $CR_PASSWORD | docker login $CR_HOSTNAME -u $CR_USERNAME --password-stdin"
|
||||
# Login to container registry
|
||||
- echo $CR_PASSWORD | buildah login -u $CR_USERNAME --password-stdin $CR_HOSTNAME
|
||||
|
||||
# build docs-simoncor-net image
|
||||
- "docker build -t docs-simoncor-net ."
|
||||
# Build image using buildah (rootless)
|
||||
- buildah bud -t docs-simoncor-net .
|
||||
|
||||
# add tags to image
|
||||
- "docker image tag docs-simoncor-net cr.simoncor.net/siempie/docs-simoncor-net:latest"
|
||||
# Tag the image for registry
|
||||
- buildah tag docs-simoncor-net cr.simoncor.net/siempie/docs-simoncor-net:latest
|
||||
|
||||
# push image to dockerhub.
|
||||
- "docker push --all-tags cr.simoncor.net/siempie/docs-simoncor-net"
|
||||
# Push the image
|
||||
- buildah push cr.simoncor.net/siempie/docs-simoncor-net:latest
|
||||
|
||||
# logout from container registry
|
||||
- "docker logout $CR_HOSTNAME"
|
||||
# Logout
|
||||
- buildah logout $CR_HOSTNAME
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue