From b76a5ce8d276c207a1b886847f0ef8e7273d5a05 Mon Sep 17 00:00:00 2001 From: Chewing_Bever Date: Wed, 19 Oct 2022 22:04:20 +0200 Subject: [PATCH] Added chages & cron job --- .woodpecker.yml | 16 ++++++++++++++++ Dockerfile | 11 +++++++---- LICENSE | 2 +- README.md | 23 +++++++---------------- 4 files changed, 31 insertions(+), 21 deletions(-) create mode 100644 .woodpecker.yml diff --git a/.woodpecker.yml b/.woodpecker.yml new file mode 100644 index 0000000..ed21980 --- /dev/null +++ b/.woodpecker.yml @@ -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 diff --git a/Dockerfile b/Dockerfile index afd8013..bb646a7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,5 @@ FROM alpine:3.15 AS bootstrapper ARG TARGETARCH -ARG PACKAGE_GROUP=base COPY files /files RUN \ apk add arch-install-scripts pacman-makepkg curl && \ @@ -20,7 +19,7 @@ RUN \ pacman-key --init && \ pacman-key --populate && \ 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 && \ echo "en_US.UTF-8 UTF-8" > /rootfs/etc/locale.gen && \ echo "LANG=en_US.UTF-8" > /rootfs/etc/locale.conf && \ @@ -29,11 +28,15 @@ RUN \ FROM scratch COPY --from=bootstrapper /rootfs/ / -ENV LANG=en_US.UTF-8 +ENV LANG=en_US.UTF-8 \ + CC=clang \ + CXX=clang++ RUN \ ln -sf /usr/lib/os-release /etc/os-release && \ pacman-key --init && \ 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"] diff --git a/LICENSE b/LICENSE index 59e2f32..d89266f 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2021 Menci +Copyright (c) 2022 Jef Roosens Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 605a3e2..6f7a60b 100644 --- a/README.md +++ b/README.md @@ -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. - -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. +* Enable LTO by default +* Use clang as the default compiler