Push the builder container

This commit is contained in:
Nikolai Rodionov 2023-04-24 20:59:30 +02:00
parent 7d4956fed3
commit df68dfe375
No known key found for this signature in database
GPG Key ID: 19DB54039EBF8F10
2 changed files with 46 additions and 0 deletions

27
.drone.yml Normal file
View File

@ -0,0 +1,27 @@
---
# ----------------------------------------------
# -- Build the site and push it to the registry
# ----------------------------------------------
kind: pipeline
type: kubernetes
name: Build badhouseplants.net
trigger:
event:
- push
steps:
- name: Prepare the builder image
image: alpine
privileged: true
environment:
GITEA_TOKEN:
from_secret: GITEA_TOKEN
BUILDAH_REG: git.badhouseplants.net/badhouseplants/badhouseplants-builder
commands:
- apk update
- apk add buildah cni-plugins iptables ip6tables
- buildah login -u allanger -p $GITEA_TOKEN git.badhouseplants.net
- buildah build -t $BUILDAH_REG:$DRONE_COMMIT_SHA -f Dockerfile-builder .
- buildah push $BUILDAH_REG:$DRONE_COMMIT_SHA

19
Containerfile Normal file
View File

@ -0,0 +1,19 @@
FROM registry.hub.docker.com/rclone/rclone AS rclone
WORKDIR /out
RUN cp $(which rclone) /out/rclone
FROM registry.hub.docker.com/argoproj/argocd as argocd
WORKDIR /out
RUN cp $(which argocd) /out/argocd
FROM registry.hub.docker.com/alpine/k8s:1.24.10 as kubectl
WORKDIR /out
RUN cp $(which kubectl) /out/kubectl
FROM registry.hub.docker.com/library/alpine
RUN apk update --no-cache&&\
apk add yq gettext openssl curl jq perl git --no-cache
COPY --from=rclone /out/rclone /usr/bin/rclone
COPY --from=argocd /out/argocd /usr/bin/argocd
COPY --from=kubectl /out/kubectl /usr/bin/kubectl