Skip to content

Commit

Permalink
Updated Dockerfile and GitHub workflow to build Flowpipe Docker image.
Browse files Browse the repository at this point in the history
  • Loading branch information
vhadianto committed Feb 8, 2024
1 parent fe7cd0a commit 87abbc5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 25 deletions.
30 changes: 6 additions & 24 deletions .github/workflows/flowpipe-container.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,10 @@ name: Container - Build and Release
on:
workflow_dispatch:
inputs:
release:
version:
description: "Flowpipe version (without 'v')"
required: true

# Sets environment variables used across all jobs in this workflow.
env:
# Sets the Flowpipe version to the input release version.
FLOWPIPE_VERSION: ${{ github.event.inputs.release }}
# Sets the GitHub write token for authorization.
GH_WRITE_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
# Sets the repository owner.
REPOSITORY_OWNER: ${{ github.repository_owner }}
# Sets the image description.
IMAGE_DESCRIPTION: 'Flowpipe is a cloud scripting engine. Automation and workflow to connect your clouds to the people, systems and data that matter.'

# Defines the build and release job.
jobs:
build_and_release:
Expand Down Expand Up @@ -46,14 +35,8 @@ jobs:
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ env.REPOSITORY_OWNER }}
password: ${{ env.GH_WRITE_TOKEN }}

# Cleans the version input for Docker tagging.
- name: Clean Version for Tag
id: generate_docker_tag
run: |
echo "docker_tag=${FLOWPIPE_VERSION#"v"}" >> $GITHUB_OUTPUT
username: ${{ github.repository_owner }}
password: ${{ secrets.GH_ACCESS_TOKEN }}

# Builds the Docker image and pushes it to the GitHub Container Registry.
- name: Build and Push to Container Registry
Expand All @@ -65,11 +48,10 @@ jobs:
push: true
platforms: linux/amd64, linux/arm64
build-args: |
TARGETVERSION=${{ env.FLOWPIPE_VERSION }}
TARGETVERSION=v${{ github.event.inputs.version }}
tags: |
ghcr.io/${{ env.REPOSITORY_OWNER }}/flowpipe:${{ steps.generate_docker_tag.outputs.docker_tag }}
ghcr.io/${{ env.REPOSITORY_OWNER }}/flowpipe:latest
outputs: type=image,name=flowpipe,annotation-index.org.opencontainers.image.description=${{ env.IMAGE_DESCRIPTION }}
ghcr.io/${{ github.repository_owner }}/flowpipe:${{ github.event.inputs.version }}
ghcr.io/${{ github.repository_owner }}/flowpipe:latest
# Outputs the image digest after the build.
- name: Image digest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/flowpipe-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
- Final
required: true
version:
description: 'Version'
description: "Version (without 'v')"
required: true
default: 0.2.0
confirmMain:
Expand Down
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ LABEL org.opencontainers.image.url="https://flowpipe.io"
LABEL org.opencontainers.image.authors="Turbot HQ, Inc"
LABEL org.opencontainers.image.source="https://github.com/turbot/flowpipe"

# Text only description, don't change to use special characters
LABEL org.opencontainers.image.description="Flowpipe container image"

# Define default environment variables to override the flowpipe UID and its GID
ENV USER_UID=7103
ENV USER_GID=0
Expand Down

0 comments on commit 87abbc5

Please sign in to comment.