Added chages & cron job
ci/woodpecker/manual/woodpecker Pipeline was successful Details

main
Jef Roosens 2022-10-19 22:04:20 +02:00
parent b0a6e227f0
commit b76a5ce8d2
Signed by: Jef Roosens
GPG Key ID: B75D4F293C7052DB
4 changed files with 31 additions and 21 deletions

16
.woodpecker.yml 100644
View File

@ -0,0 +1,16 @@
platform: 'linux/amd64'
branches: [main]
pipeline:
build:
image: 'woodpeckerci/plugin-docker-buildx'
secrets:
- 'docker_username'
- 'docker_password'
settings:
repo: 'git.rustybever.be/vieter-v/vieter-builder'
tags:
- 'latest'
platforms: [ 'linux/arm64/v8', 'linux/amd64' ]
when:
event: cron

View File

@ -1,6 +1,5 @@
FROM alpine:3.15 AS bootstrapper FROM alpine:3.15 AS bootstrapper
ARG TARGETARCH ARG TARGETARCH
ARG PACKAGE_GROUP=base
COPY files /files COPY files /files
RUN \ RUN \
apk add arch-install-scripts pacman-makepkg curl && \ apk add arch-install-scripts pacman-makepkg curl && \
@ -20,7 +19,7 @@ RUN \
pacman-key --init && \ pacman-key --init && \
pacman-key --populate && \ pacman-key --populate && \
mkdir /rootfs && \ mkdir /rootfs && \
/files/pacstrap-docker /rootfs $PACKAGE_GROUP && \ /files/pacstrap-docker /rootfs base-devel clang git && \
cp /etc/pacman.d/mirrorlist /rootfs/etc/pacman.d/mirrorlist && \ cp /etc/pacman.d/mirrorlist /rootfs/etc/pacman.d/mirrorlist && \
echo "en_US.UTF-8 UTF-8" > /rootfs/etc/locale.gen && \ echo "en_US.UTF-8 UTF-8" > /rootfs/etc/locale.gen && \
echo "LANG=en_US.UTF-8" > /rootfs/etc/locale.conf && \ echo "LANG=en_US.UTF-8" > /rootfs/etc/locale.conf && \
@ -29,11 +28,15 @@ RUN \
FROM scratch FROM scratch
COPY --from=bootstrapper /rootfs/ / COPY --from=bootstrapper /rootfs/ /
ENV LANG=en_US.UTF-8 ENV LANG=en_US.UTF-8 \
CC=clang \
CXX=clang++
RUN \ RUN \
ln -sf /usr/lib/os-release /etc/os-release && \ ln -sf /usr/lib/os-release /etc/os-release && \
pacman-key --init && \ pacman-key --init && \
pacman-key --populate && \ pacman-key --populate && \
rm -rf /etc/pacman.d/gnupg/{openpgp-revocs.d/,private-keys-v1.d/,pubring.gpg~,gnupg.S.}* rm -rf /etc/pacman.d/gnupg/{openpgp-revocs.d/,private-keys-v1.d/,pubring.gpg~,gnupg.S.}* && \
# Enable LTO by default \
sed -i 's/!lto/lto/' /etc/makepkg.conf
CMD ["/usr/bin/bash"] CMD ["/usr/bin/bash"]

View File

@ -1,6 +1,6 @@
MIT License MIT License
Copyright (c) 2021 Menci Copyright (c) 2022 Jef Roosens
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -1,18 +1,9 @@
# Arch Linux Docker Image (Multiarch) # Vieter builder image
[![Build and Push](https://github.com/Menci/docker-archlinuxarm/actions/workflows/build.yaml/badge.svg)](https://github.com/Menci/docker-archlinuxarm/actions/workflows/build.yaml) This repo is a fork of
[Menci/docker-archlinuxarm](https://github.com/Menci/docker-archlinuxarm),
meant as a way for me to configure my build images a bit better. In specific, I
added the following changes:
This is the Docker image for Arch Linux ARM but for compatibility AMD64 build is also included. All images are built on GitHub Actions automatically. * Enable LTO by default
* Use clang as the default compiler
Just just like the official Arch Linux AMD64 image, it has two tags:
* `base` (default): installed only the package group `base`.
* `base-devel`: installed the package group `base-devel`.
And, the pamcan lsign-key is also removed for [security reasons](https://gitlab.archlinux.org/archlinux/archlinux-docker/-/blob/bc4d9f8ec5bdcbedefc96a2a1beaf33f01c07812/README.md#principles).
# Under the Hood
The Dockerfile uses a Alpine Linux container to install `pacman` and bootstrap the Arch Linux ARM rootfs. Since `pacstrap` uses `mount`, it doesn't run in an unprivileged Docker container. I found the tool [`pacstrap-docker`](https://github.com/lopsided98/archlinux-docker/blob/d5a80b90aea37eee43bcc7efeaea69880a4aada7/pacstrap-docker) ([LICENSE](https://github.com/lopsided98/archlinux-docker/blob/d5a80b90aea37eee43bcc7efeaea69880a4aada7/LICENSE)) as a replacement.
After bootstrapping, the rootfs will be copied to a new container from `scratch` (aka. an empty file system), which will be commited as the result image.