Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Docker Image CI

on:
push:
branches:
- main
tags:
- v*
pull_request:
workflow_dispatch:
inputs:
VERSION:
description: 'target version of image'
required: true
default: '0.2.0'

permissions:
packages: write
contents: read
jobs:
docker:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

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

- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
if: github.event_name == 'push'
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ github.repository_owner }}/featinsight
flavor:
latest=false
tags: |
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}
type=raw,value=${{ github.event.inputs.VERSION }},enable=${{ github.event_name == 'workflow_dispatch' }}
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}

- name: Build And Push
id: docker_build
uses: docker/build-push-action@v6
with:
push: ${{ github.event_name == 'push' }}
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
context: docker
16 changes: 12 additions & 4 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
FROM openjdk:17-oracle
FROM openjdk:17-oracle AS base

# feat insight version
ARG VERSION=0.2.0
ARG TARGETARCH
WORKDIR /app

ADD featinsight-0.1.0-SNAPSHOT.jar /app/
FROM base AS base_amd64
ONBUILD ADD https://github.com/4paradigm/FeatInsight/releases/download/v${VERSION}/featinsight-${VERSION}.jar /app/

EXPOSE 8888
FROM base AS base_arm64
ONBUILD ADD https://github.com/4paradigm/FeatInsight/releases/download/v${VERSION}/featinsight-${VERSION}-linux-aarch64.jar /app/featinsight-${VERSION}.jar

FROM base_${TARGETARCH}

CMD ["java", "-jar", "/app/featinsight-0.1.0-SNAPSHOT.jar"]
EXPOSE 8888

CMD ["java", "-jar", "/app/featinsight-${VRESION}.jar"]