Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
dominicporteous committed Apr 8, 2024
1 parent d064dbb commit e9c44a9
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Create and publish Docker image

on:
push:
branches:
- master
tags:
- "*"
pull_request:
branches:
- "master"

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: match-tag-to-package-version
uses: geritol/[email protected]
with:
TAG_PREFIX: ""
if: ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags/') }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags/') }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
16 changes: 16 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM bitnami/kubectl:1.29-debian-12

USER root

RUN apt-get update \
&& apt-get install rsync s3cmd curl -y \
&& rm -rf /var/lib/apt/lists/*

RUN curl -sSL https://github.com/vmware-tanzu/velero/releases/download/v1.13.1/velero-v1.13.1-linux-amd64.tar.gz -o velero-v1.13.1-linux-amd64.tar.gz \
&& tar -xvf velero-v1.13.1-linux-amd64.tar.gz \
&& mv velero-v1.13.1-linux-amd64/velero /usr/local/bin/velero \
&& chmod +x /usr/local/bin/velero \
&& rm -rf ./velero-v1.13.1-linux-amd64 velero-v1.13.1-linux-amd64.tar.gz \
&& velero --help

USER 1001

0 comments on commit e9c44a9

Please sign in to comment.