blob: 39e24e76e94469fe23aaa42dd65363533324bc44 [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: ubuntu-latest
strategy:
fail-fast: false
matrix:
config:
- { platform: "ubuntu", arch: "amd64" }
- { platform: "fedora", arch: "amd64" }
- { platform: "archlinux", arch: "amd64" }
- { platform: "alpine", arch: "amd64" }
- { platform: "centos7", arch: "amd64" }
- { platform: "ubuntu", arch: "arm64" }
- { platform: "alpine", arch: "arm64" }
- { platform: "centos7", arch: "arm64" }
- { platform: "alpine", arch: "s390x" }
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
persist-credentials: false
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- 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 != 'amd64'
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
# Build some arch-agnostic images for non-verify docker bits
build-docker-manifest:
runs-on: ubuntu-latest
needs: build-docker
steps:
- 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: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:centos7
docker manifest push ghcr.io/apache/arrow-nanoarrow:alpine