48 lines
2.2 KiB
YAML
48 lines
2.2 KiB
YAML
name: probe-arm
|
|
on:
|
|
push:
|
|
branches: [ci/probe-arm]
|
|
jobs:
|
|
kaniko-explicit-platform:
|
|
runs-on: docker
|
|
container:
|
|
image: gcr.io/kaniko-project/executor:v1.23.2-debug
|
|
steps:
|
|
- name: arm64 with the build stages pinned to amd64
|
|
env:
|
|
REGISTRY_TOKEN: ${{ secrets.FORGEJO_TOKEN }}
|
|
run: |
|
|
set -eu
|
|
mkdir -p /kaniko/.docker
|
|
auth="$(printf '%s:%s' squid "$REGISTRY_TOKEN" | base64 | tr -d '\n')"
|
|
printf '{"auths":{"git.kmalloc.org":{"auth":"%s"}}}' "$auth" > /kaniko/.docker/config.json
|
|
/kaniko/executor --custom-platform linux/arm64 --dockerfile Dockerfile \
|
|
--context "git://git.kmalloc.org/squid/sonda.git#refs/heads/ci/probe-arm" \
|
|
--build-arg TARGETOS=linux --build-arg TARGETARCH=arm64 --build-arg VERSION=probeA \
|
|
--destination git.kmalloc.org/squid/sonda:probeA-arm64 --verbosity info
|
|
|
|
buildah:
|
|
runs-on: docker
|
|
steps:
|
|
- name: Can buildah assemble an arm64 image here, with no daemon and no emulation?
|
|
env:
|
|
REGISTRY_TOKEN: ${{ secrets.FORGEJO_TOKEN }}
|
|
run: |
|
|
set -eu
|
|
apt-get update -qq >/dev/null && apt-get install -y -qq buildah >/dev/null 2>&1
|
|
buildah --version
|
|
export STORAGE_DRIVER=vfs BUILDAH_ISOLATION=chroot
|
|
mkdir -p /tmp/ctx/data && printf '#!/bin/sh\necho hello\n' > /tmp/ctx/hello && chmod +x /tmp/ctx/hello
|
|
for arch in amd64 arm64; do
|
|
c=$(buildah from --arch "$arch" --os linux docker.io/library/alpine:3.22)
|
|
buildah copy "$c" /tmp/ctx/hello /usr/local/bin/hello
|
|
buildah copy --chown 10001:10001 "$c" /tmp/ctx/data /data
|
|
buildah config --user 10001:10001 --workingdir /data --entrypoint '["hello"]' "$c"
|
|
buildah commit "$c" "localhost/probe:$arch"
|
|
done
|
|
buildah login -u squid -p "$REGISTRY_TOKEN" git.kmalloc.org
|
|
buildah manifest create probeB
|
|
buildah manifest add probeB localhost/probe:amd64
|
|
buildah manifest add probeB localhost/probe:arm64
|
|
buildah manifest push --all probeB docker://git.kmalloc.org/squid/sonda:probeB
|
|
echo done
|