Skip to content

docker image

docker image #28

Workflow file for this run

name: docker image
on:
workflow_dispatch:
inputs:
NIM_VERSION:
description: "nim version"
required: true
default: "2.0.8"
type: string
NIMBLE_VERSION:
description: "nimble version"
required: true
default: "bundled"
type: string
BASE:
type: choice
description: "whether the base image should be alpine or ubuntu"
options:
- alpine
- ubuntu
message:
required: true
required: true
default: "ubuntu"
permissions:
packages: write
contents: read
jobs:
release:
runs-on: ${{ matrix.builder }}
strategy:
matrix:
include:
- builder: ubuntu-22.04
platform: amd64
- builder: buildjet-2vcpu-ubuntu-2204-arm
platform: arm64
steps:
- name: Checkout Code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # 4.1.7
# not necessary as build is native on ARM
# - name: Set up QEMU
# uses: docker/setup-qemu-action@5927c834f5b4fdf503fca6f4c7eccda82949e1ee # 3.1.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@4fd812986e6c8c2a69e18311145f9371337f27d4 # 3.4.0
- name: Set up Chalk
uses: crashappsec/setup-chalk-action@main
- name: Login to GitHub Container Registry
uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # 3.2.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ github.token }}
- name: Docker versions
run: |
docker info
docker version
- name: Build and Push Docker Image
uses: docker/build-push-action@1ca370b3a9802c92e886402e0dd88098a2533b12 # 6.4.1
with:
file: Dockerfile.${{ inputs.BASE }}
push: true
provenance: false # https://github.com/docker/buildx/issues/1608
platforms: linux/${{ matrix.platform }}
build-args: |
NIM_VERSION=${{ inputs.NIM_VERSION }}
NIMBLE_VERSION=${{ inputs.NIMBLE_VERSION }}
tags: |
ghcr.io/${{ github.repository_owner }}/nim:${{ inputs.BASE }}-latest-${{ matrix.platform }}
ghcr.io/${{ github.repository_owner }}/nim:${{ inputs.BASE }}-${{ inputs.NIM_VERSION }}-${{ matrix.platform }}
manifest:
runs-on: ubuntu-22.04
needs: release
steps:
- name: Login to GitHub Container Registry
uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # 3.2.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ github.token }}
- name: Create and push manifest images for latest
uses: Noelware/docker-manifest-action@54262c97373814c17a990343f23cdfba180ff0cc # 0.4.2
with:
inputs: ghcr.io/${{ github.repository_owner }}/nim:${{ inputs.BASE }}-latest
images: ghcr.io/${{ github.repository_owner }}/nim:${{ inputs.BASE }}-latest-amd64,ghcr.io/${{ github.repository_owner }}/nim:${{ inputs.BASE }}-latest-arm64
push: true
- name: Create and push manifest images for specific version
uses: Noelware/docker-manifest-action@54262c97373814c17a990343f23cdfba180ff0cc # 0.4.2
with:
inputs: ghcr.io/${{ github.repository_owner }}/nim:${{ inputs.BASE }}-${{ inputs.NIM_VERSION }}
images: ghcr.io/${{ github.repository_owner }}/nim:${{ inputs.BASE }}-${{ inputs.NIM_VERSION }}-amd64,ghcr.io/${{ github.repository_owner }}/nim:${{ inputs.BASE }}-${{ inputs.NIM_VERSION }}-arm64
push: true