Skip to content

docker-build

docker-build #167

Workflow file for this run

# 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: docker-build
on:
workflow_dispatch:
schedule:
- cron: '5 0 * * 6'
pull_request:
paths:
- 'ci/docker/*'
- '.github/workflows/docker-build.yaml'
- 'docker-compose.yaml'
permissions:
contents: read
packages: write
concurrency:
group: ${{ github.repository }}-${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true
jobs:
build-docker:
name: "${{ matrix.config.service }}-${{ 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", service: "verify" }
- { runs_on: "ubuntu-latest", platform: "fedora", arch: "amd64", service: "verify" }
- { runs_on: "ubuntu-latest", platform: "archlinux", arch: "amd64", service: "verify" }
- { runs_on: "ubuntu-latest", platform: "alpine", arch: "amd64", service: "verify" }
- { runs_on: ["self-hosted", "arm"], platform: "ubuntu", arch: "arm64", service: "verify" }
- { runs_on: ["self-hosted", "arm"], platform: "fedora", arch: "arm64", service: "verify" }
- { runs_on: ["self-hosted", "arm"], platform: "alpine", arch: "arm64", service: "verify" }
- { runs_on: "ubuntu-latest", platform: "alpine", arch: "s390x", service: "verify" }
env:
DOCKER_CLIENT_TIMEOUT: 360
COMPOSE_HTTP_TIMEOUT: 360
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@v3
with:
endpoint: builders
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
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@v3
- 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 || 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 ${{ matrix.config.service }} || \
docker-compose push ${{ matrix.config.service }}
# 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@v3
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: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:alpine