Skip to content

Commit 3eff657

Browse files
committed
Switch to GitHub Actions to resume builds
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.
1 parent c004bc8 commit 3eff657

9 files changed

Lines changed: 78 additions & 60 deletions

File tree

.github/workflows/build-deploy.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Build and Deploy
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
schedule:
11+
- cron: '0 0 * * 0' # Run weekly on Sunday at midnight
12+
workflow_dispatch:
13+
14+
jobs:
15+
build:
16+
runs-on: ubuntu-latest
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
arch:
21+
- arm32v7
22+
- arm64v8
23+
steps:
24+
- uses: actions/checkout@v2
25+
- name: Enable Docker experimental mode for image squashing
26+
if: github.actor != 'nektos/act'
27+
run: |
28+
echo '{ "experimental": true }' | sudo tee /etc/docker/daemon.json
29+
sudo systemctl restart docker
30+
- name: Setup dependencies
31+
run: |
32+
sudo apt-get update && \
33+
sudo apt-get --yes --no-install-recommends install qemu-user-static
34+
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
35+
chmod -R g-w ./
36+
- name: Build images
37+
run: ./build
38+
env:
39+
BUILD_ARCH: ${{ matrix.arch }}
40+
DOCKER_ORG: ${{ secrets.DOCKER_USERNAME }}
41+
- name: Deploy images
42+
if: github.event_name != 'pull_request'
43+
run: docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" && ./push
44+
env:
45+
BUILD_ARCH: ${{ matrix.arch }}
46+
DOCKER_ORG: ${{ secrets.DOCKER_USERNAME }}
47+
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
48+
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
49+
50+
manifests:
51+
runs-on: ubuntu-latest
52+
if: github.event_name != 'pull_request'
53+
needs:
54+
- build
55+
steps:
56+
- uses: actions/checkout@v2
57+
- name: Setup dependencies
58+
run: docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
59+
env:
60+
DOCKER_ORG: ${{ secrets.DOCKER_USERNAME }}
61+
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
62+
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
63+
- name: Create Manifest
64+
run: ./create-manifest
65+
env:
66+
DOCKER_ORG: ${{ secrets.DOCKER_USERNAME }}

.travis.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.

Dockerfile.arm32v7

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ RUN mkdir -p /archlinux/rootfs
77
COPY pacstrap-docker /archlinux/
88

99
RUN ./pacstrap-docker /archlinux/rootfs \
10-
bash sed gzip pacman
10+
bash sed gzip pacman archlinuxarm-keyring
1111

1212
# Remove current pacman database, likely outdated very soon
1313
RUN rm rootfs/var/lib/pacman/sync/*

Dockerfile.arm64v8

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ RUN mkdir -p /archlinux/rootfs
77
COPY pacstrap-docker /archlinux/
88

99
RUN ./pacstrap-docker /archlinux/rootfs \
10-
bash sed gzip pacman
10+
bash sed gzip pacman archlinuxarm-keyring
1111

1212
# Remove current pacman database, likely outdated very soon
1313
RUN rm rootfs/var/lib/pacman/sync/*

README.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# 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)
1+
# 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)
22

33
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.
44

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

1717
| Tag | Update | Type | Description |
1818
|:------:|:----------:|:-------:|:-----------------------------------------------------------------------------------|
19-
| latest | **weekly** | minimal | minimal Arch Linux ARM with pacman support |
19+
| latest | **weekly** | minimal | minimal Arch Linux ARM with pacman support |
2020

2121
### Layer structure
2222

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

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

4847
### Building
4948

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

55-
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!*
54+
If you want to push the images, run `DOCKER_ORG=<your_docker_org> ./push`.
5655

5756
### Building from scratch
5857

build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash -ex
22

33
DOCKER_ARCH=${BUILD_ARCH:-arm32v7}
4-
DOCKER_ORG=agners
4+
DOCKER_ORG=${DOCKER_ORG:-agners}
55
DOCKER_IMAGE=archlinuxarm-${DOCKER_ARCH}
66

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

create-manifest

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
#!/bin/bash -ex
22

3-
DOCKER_ORG=agners
3+
DOCKER_ORG=${DOCKER_ORG:-agners}
44
DOCKER_IMAGE=archlinuxarm
55

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

88
for TAG in $TAGS
99
do
1010
docker manifest create --amend $DOCKER_ORG/$DOCKER_IMAGE:$TAG \
11-
$DOCKER_ORG/$DOCKER_IMAGE-arm32v7:$TAG \
12-
$DOCKER_ORG/$DOCKER_IMAGE-arm64v8:$TAG
11+
$DOCKER_ORG/$DOCKER_IMAGE-arm32v7:$TAG \
12+
$DOCKER_ORG/$DOCKER_IMAGE-arm64v8:$TAG
1313

1414
docker manifest annotate $DOCKER_ORG/$DOCKER_IMAGE:$TAG \
1515
$DOCKER_ORG/$DOCKER_IMAGE-arm32v7:$TAG \

prepare-qemu

Lines changed: 0 additions & 18 deletions
This file was deleted.

push

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash -ex
22

33
DOCKER_ARCH=${BUILD_ARCH:-arm32v7}
4-
DOCKER_ORG=agners
4+
DOCKER_ORG=${DOCKER_ORG:-agners}
55
DOCKER_IMAGE=archlinuxarm-${DOCKER_ARCH}
66

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

0 commit comments

Comments
 (0)