Skip to content

Commit

Permalink
Switch to GitHub Actions to resume builds
Browse files Browse the repository at this point in the history
Travis stopped building images on their .org instance on 15 Jun 2021,
leaving the last push to Docker Hub on 19 May 2021. That's a few months
out of date, now, which causes pulls to have lots of updates to run on
startup. In the interest of getting builds going again, and moving away
from Travis, here is a switch to GitHub Actions instead. I also replaced
the QEMU setup script with a Docker image designed to do the same thing,
mostly so the builds would complete.
  • Loading branch information
hennikatsoci committed Mar 8, 2023
1 parent c004bc8 commit 69c5864
Show file tree
Hide file tree
Showing 7 changed files with 76 additions and 58 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/build-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Build and Deploy

on:
push:
branches:
- master
pull_request:
branches:
- master
schedule:
- cron: '0 0 * * 0' # Run weekly on Sunday at midnight
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
arch:
- arm32v7
- arm64v8
steps:
- uses: actions/checkout@v2
- name: Enable Docker experimental mode for image squashing
if: github.actor != 'nektos/act'
run: |
echo '{ "experimental": true }' | sudo tee /etc/docker/daemon.json
sudo systemctl restart docker
- name: Setup dependencies
run: |
sudo apt-get update && \
sudo apt-get --yes --no-install-recommends install qemu-user-static
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
chmod -R g-w ./
- name: Build images
run: ./build
env:
BUILD_ARCH: ${{ matrix.arch }}
DOCKER_ORG: ${{ secrets.DOCKER_USERNAME }}
- name: Deploy images
if: github.event_name != 'pull_request'
run: docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" && ./push
env:
BUILD_ARCH: ${{ matrix.arch }}
DOCKER_ORG: ${{ secrets.DOCKER_USERNAME }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}

manifests:
runs-on: ubuntu-latest
if: github.event_name != 'pull_request'
needs:
- build
steps:
- uses: actions/checkout@v2
- name: Setup dependencies
run: docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
env:
DOCKER_ORG: ${{ secrets.DOCKER_USERNAME }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
- name: Create Manifest
run: ./create-manifest
env:
DOCKER_ORG: ${{ secrets.DOCKER_USERNAME }}
29 changes: 0 additions & 29 deletions .travis.yml

This file was deleted.

11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Basic Arch Linux ARM Docker images [![Build Status](https://travis-ci.org/agners/archlinuxarm-docker.svg?branch=master)](https://travis-ci.org/agners/archlinuxarm-docker)
# Basic Arch Linux ARM Docker images [![Build and Deploy](https://github.com/agners/archlinuxarm-docker/actions/workflows/build-deploy.yml/badge.svg)](https://github.com/agners/archlinuxarm-docker/actions/workflows/build-deploy.yml)

Docker images for Arch Linux ARM on AArch32 (ARMv7-A) and AArch64 (ARMv8-A). Built using native pacman and Docker multi-stage builds. Builds weekly by Travis CI on publicly visible infrastructure using Qemu emulation.

Expand All @@ -16,7 +16,7 @@ Instead of using the multi-arch container above, you can also get the architectu

| Tag | Update | Type | Description |
|:------:|:----------:|:-------:|:-----------------------------------------------------------------------------------|
| latest | **weekly** | minimal | minimal Arch Linux ARM with pacman support |
| latest | **weekly** | minimal | minimal Arch Linux ARM with pacman support |

### Layer structure

Expand All @@ -43,16 +43,15 @@ docker run -e TZ=Europe/Berlin agners/archlinuxarm
### Prerequisites

- Docker with experimental mode on (required for squash)
- sudo or root is neccessary to setup binfmt for Qemu user mode emulation

### Building

- Prepare binfmt use with Qemu user mode using `sudo ./prepare-qemu`
- Run `BUILD_ARCH=<arch> ./build` to build
- Prepare binfmt use with Qemu user mode using `docker run --rm --privileged multiarch/qemu-user-static --reset -p yes`
- Run `BUILD_ARCH=<arch> DOCKER_ORG=<your_docker_org> ./build` to build
- Use `BUILD_ARCH=arm32v7` for ARMv7 Aarch32
- Use `BUILD_ARCH=arm64v8` for ARMv8 Aarch64

If you want to push the images, run `./push`. *But be aware you have no push access to the repos! Edit the scripts to push to custom Docker Hub locations!*
If you want to push the images, run `DOCKER_ORG=<your_docker_org> ./push`.

### Building from scratch

Expand Down
2 changes: 1 addition & 1 deletion build
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash -ex

DOCKER_ARCH=${BUILD_ARCH:-arm32v7}
DOCKER_ORG=agners
DOCKER_ORG=${DOCKER_ORG:-agners}
DOCKER_IMAGE=archlinuxarm-${DOCKER_ARCH}

TAG_DATE=$(date +'%Y%m%d')
Expand Down
6 changes: 3 additions & 3 deletions create-manifest
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#!/bin/bash -ex

DOCKER_ORG=agners
DOCKER_ORG=${DOCKER_ORG:-agners}
DOCKER_IMAGE=archlinuxarm

TAGS="latest $(date +'%Y%m%d')"

for TAG in $TAGS
do
docker manifest create --amend $DOCKER_ORG/$DOCKER_IMAGE:$TAG \
$DOCKER_ORG/$DOCKER_IMAGE-arm32v7:$TAG \
$DOCKER_ORG/$DOCKER_IMAGE-arm64v8:$TAG
$DOCKER_ORG/$DOCKER_IMAGE-arm32v7:$TAG \
$DOCKER_ORG/$DOCKER_IMAGE-arm64v8:$TAG

docker manifest annotate $DOCKER_ORG/$DOCKER_IMAGE:$TAG \
$DOCKER_ORG/$DOCKER_IMAGE-arm32v7:$TAG \
Expand Down
18 changes: 0 additions & 18 deletions prepare-qemu

This file was deleted.

2 changes: 1 addition & 1 deletion push
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash -ex

DOCKER_ARCH=${BUILD_ARCH:-arm32v7}
DOCKER_ORG=agners
DOCKER_ORG=${DOCKER_ORG:-agners}
DOCKER_IMAGE=archlinuxarm-${DOCKER_ARCH}

TAG_DATE=$(date +'%Y%m%d')
Expand Down

0 comments on commit 69c5864

Please sign in to comment.