Last active
April 19, 2022 11:05
-
-
Save tomkukral/7d94eb60774d351433036f3cc4546aad to your computer and use it in GitHub Desktop.
Gitlab CI with buildah
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export DOCKER_REGISTRY="docker.io" | |
export SERVICE="vp" | |
export ARTIFACT_TAG=$(git rev-parse HEAD) | |
# build image | |
buildah bud -t ${DOCKER_REGISTRY}/${SERVICE}:${ARTIFACT_TAG} . | |
# push | |
buildah push ${DOCKER_REGISTRY}/$(SERVICE):${ARTIFACT_TAG} docker://${DOCKER_REGISTRY}/${SERVICE}:${ARTIFACT_TAG} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[[runners]] | |
name = "Kubernetes Runner" | |
url = "https://gitlab.com/ci" | |
token = "{{ .gitlab_runner_token }}" | |
executor = "kubernetes" | |
[runners.kubernetes] | |
namespace = "gitlab" | |
[[runners.kubernetes.volumes.host_path]] | |
name = "docker" | |
mount_path = "/var/run/docker.sock" | |
read_only = false | |
[[runners.kubernetes.volumes.host_path]] | |
name = "buildah" | |
mount_path = "/var/lib/containers/" | |
read_only = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM fedora | |
RUN dnf install -y \ | |
buildah \ | |
podman \ | |
make \ | |
&& \ | |
dnf clean all |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment