Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to GitHub Actions to resume builds #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

2 changes: 1 addition & 1 deletion Dockerfile.arm32v7
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ RUN mkdir -p /archlinux/rootfs
COPY pacstrap-docker /archlinux/

RUN ./pacstrap-docker /archlinux/rootfs \
bash sed gzip pacman
bash sed gzip pacman archlinuxarm-keyring

# Remove current pacman database, likely outdated very soon
RUN rm rootfs/var/lib/pacman/sync/*
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.arm64v8
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ RUN mkdir -p /archlinux/rootfs
COPY pacstrap-docker /archlinux/

RUN ./pacstrap-docker /archlinux/rootfs \
bash sed gzip pacman
bash sed gzip pacman archlinuxarm-keyring

# Remove current pacman database, likely outdated very soon
RUN rm rootfs/var/lib/pacman/sync/*
Expand Down
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