Skip to content

Commit

Permalink
add dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
topahadzi committed Sep 12, 2023
0 parents commit 2d44630
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 0 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: docker

on:
push:
tags:
- "v*"

env:
REGISTRY: ghcr.io
IMAGE_NAME: telkomindonesia/db-backup-docker

jobs:
release:
runs-on: ubuntu-latest

steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- id: docker_meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- id: docker_build
name: Build and push Docker image
uses: docker/build-push-action@v3
with:
platforms: linux/amd64
push: true
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}

- name: Install Cosign
uses: sigstore/cosign-installer@main

- name: Sign image with a key
run: |
cosign sign --key env://COSIGN_PRIVATE_KEY ${IMAGE_NAME,,}@${IMAGE_DIGEST} --yes
env:
IMAGE_NAME: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
IMAGE_DIGEST: ${{ steps.docker_build.outputs.digest }}
COSIGN_PRIVATE_KEY: ${{secrets.COSIGN_PRIVATE_KEY}}
COSIGN_PASSWORD: ${{secrets.COSIGN_PASSWORD}}
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM alpine:latest

ARG RCLONE_VER=v1.64.0
ARG LINKERD_AWAIT_VERSION=v0.2.7
WORKDIR /app
RUN apk update && apk add postgresql curl unzip
RUN curl -O https://downloads.rclone.org/${RCLONE_VER}/rclone-${RCLONE_VER}-linux-amd64.zip
RUN unzip rclone-${RCLONE_VER}-linux-amd64.zip && rm rclone-${RCLONE_VER}-linux-amd64.zip
RUN cp rclone-${RCLONE_VER}-linux-amd64/rclone /usr/local/bin/
RUN curl -sSLo /tmp/linkerd-await https://github.com/linkerd/linkerd-await/releases/download/release%2F${LINKERD_AWAIT_VERSION}/linkerd-await-${LINKERD_AWAIT_VERSION}-amd64 && \
chmod 755 /tmp/linkerd-await
RUN cp /tmp/linkerd-await /usr/local/bin/
ENTRYPOINT ["linkerd-await", "--shutdown", "--"]

0 comments on commit 2d44630

Please sign in to comment.