blob: 3ffd6b6859d59ec755b42041c00f2352dbd0b738 [file] [log] [blame]
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
name: Build Docker Images
on:
workflow_dispatch:
schedule:
- cron: '5 0 * * 6'
pull_request:
paths:
- 'ci/docker/*'
- '.github/workflow/docker-build.yaml'
- 'docker-compose.yaml'
permissions:
contents: read
packages: write
jobs:
build-docker:
name: "docker-${{ matrix.config.platform }}-${{ matrix.config.arch }}"
runs-on: ${{ matrix.config.runs_on }}
strategy:
fail-fast: false
matrix:
config:
- { runs_on: "ubuntu-latest", platform: "ubuntu", arch: "amd64" }
- { runs_on: "ubuntu-latest", platform: "fedora", arch: "amd64" }
- { runs_on: "ubuntu-latest", platform: "archlinux", arch: "amd64" }
- { runs_on: "ubuntu-latest", platform: "alpine", arch: "amd64" }
- { runs_on: "ubuntu-latest", platform: "centos7", arch: "amd64" }
- { runs_on: ["self-hosted", "arm"], platform: "ubuntu", arch: "arm64" }
- { runs_on: ["self-hosted", "arm"], platform: "fedora", arch: "arm64" }
- { runs_on: ["self-hosted", "arm"], platform: "alpine", arch: "arm64" }
- { runs_on: ["self-hosted", "arm"], platform: "centos7", arch: "arm64" }
- { runs_on: "ubuntu-latest", platform: "alpine", arch: "s390x" }
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- name: Create Docker Context for Buildx
run: |
docker context create builders
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
endpoint: builders
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
if: matrix.config.arch == 's390x'
uses: docker/setup-qemu-action@v2
- name: Build
env:
NANOARROW_ARCH: ${{ matrix.config.arch }}
NANOARROW_PLATFORM: ${{ matrix.config.platform }}
DOCKER_DEFAULT_PLATFORM: "linux/${{ matrix.config.arch }}"
run: |
docker-compose build verify
- name: Push
if: ${{ github.event_name != 'pull_request' && github.repository == 'apache/arrow-nanoarrow'}}
env:
NANOARROW_ARCH: ${{ matrix.config.arch }}
NANOARROW_PLATFORM: ${{ matrix.config.platform }}
DOCKER_DEFAULT_PLATFORM: "linux/${{ matrix.config.arch }}"
run: |
docker-compose push verify
# Build some arch-agnostic images for non-verify docker bits
build-docker-manifest:
runs-on: ubuntu-latest
needs: build-docker
steps:
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build
run: |
docker manifest create \
ghcr.io/apache/arrow-nanoarrow:ubuntu \
ghcr.io/apache/arrow-nanoarrow:ubuntu-amd64 \
ghcr.io/apache/arrow-nanoarrow:ubuntu-arm64
docker manifest annotate \
ghcr.io/apache/arrow-nanoarrow:ubuntu \
ghcr.io/apache/arrow-nanoarrow:ubuntu-amd64 --arch amd64
docker manifest annotate \
ghcr.io/apache/arrow-nanoarrow:ubuntu \
ghcr.io/apache/arrow-nanoarrow:ubuntu-arm64 --arch arm64
docker manifest create \
ghcr.io/apache/arrow-nanoarrow:centos7 \
ghcr.io/apache/arrow-nanoarrow:centos7-amd64 \
ghcr.io/apache/arrow-nanoarrow:centos7-arm64
docker manifest annotate \
ghcr.io/apache/arrow-nanoarrow:centos7 \
ghcr.io/apache/arrow-nanoarrow:centos7-amd64 --arch amd64
docker manifest annotate \
ghcr.io/apache/arrow-nanoarrow:centos7 \
ghcr.io/apache/arrow-nanoarrow:centos7-arm64 --arch arm64
docker manifest create \
ghcr.io/apache/arrow-nanoarrow:fedora \
ghcr.io/apache/arrow-nanoarrow:fedora-amd64 \
ghcr.io/apache/arrow-nanoarrow:fedora-arm64
docker manifest annotate \
ghcr.io/apache/arrow-nanoarrow:fedora \
ghcr.io/apache/arrow-nanoarrow:fedora-amd64 --arch amd64
docker manifest annotate \
ghcr.io/apache/arrow-nanoarrow:fedora \
ghcr.io/apache/arrow-nanoarrow:fedora-arm64 --arch arm64
docker manifest create \
ghcr.io/apache/arrow-nanoarrow:alpine \
ghcr.io/apache/arrow-nanoarrow:alpine-amd64 \
ghcr.io/apache/arrow-nanoarrow:alpine-arm64 \
ghcr.io/apache/arrow-nanoarrow:alpine-s390x
docker manifest annotate \
ghcr.io/apache/arrow-nanoarrow:alpine \
ghcr.io/apache/arrow-nanoarrow:alpine-amd64 --arch amd64
docker manifest annotate \
ghcr.io/apache/arrow-nanoarrow:alpine \
ghcr.io/apache/arrow-nanoarrow:alpine-arm64 --arch arm64
docker manifest annotate \
ghcr.io/apache/arrow-nanoarrow:alpine \
ghcr.io/apache/arrow-nanoarrow:alpine-s390x --arch s390x
- name: Push
if: ${{ github.event_name != 'pull_request' && github.repository == 'apache/arrow-nanoarrow'}}
run: |
docker manifest push ghcr.io/apache/arrow-nanoarrow:ubuntu
docker manifest push ghcr.io/apache/arrow-nanoarrow:fedora
docker manifest push ghcr.io/apache/arrow-nanoarrow:centos7
docker manifest push ghcr.io/apache/arrow-nanoarrow:alpine