Add aports container image
This commit is contained in:
parent
b6888be613
commit
ed9fe0f432
|
@ -0,0 +1,35 @@
|
||||||
|
# https://wiki.alpinelinux.org/wiki/Creating_an_Alpine_package
|
||||||
|
# This image build an intermediated environment to build + test Alpine packages
|
||||||
|
#
|
||||||
|
# Usage:
|
||||||
|
# $ podman run --rm -it -v ~/packages:/home/kawaii/packages localhost/aports
|
||||||
|
# => doas chown kawaii:users ~/packages
|
||||||
|
FROM alpine:edge
|
||||||
|
|
||||||
|
# Change repositories
|
||||||
|
RUN printf 'https://download.nus.edu.sg/mirror/alpine/edge/main\n\
|
||||||
|
https://download.nus.edu.sg/mirror/alpine/edge/community\n\
|
||||||
|
https://download.nus.edu.sg/mirror/alpine/edge/testing\n' > /etc/apk/repositories
|
||||||
|
|
||||||
|
RUN apk add --no-cache alpine-sdk doas vim \
|
||||||
|
&& mkdir -p /var/cache/distfiles \
|
||||||
|
&& chgrp abuild /var/cache/distfiles \
|
||||||
|
&& chmod g+x /var/cache/distfiles
|
||||||
|
|
||||||
|
# Create a normal user
|
||||||
|
RUN echo 'permit nopass :wheel' > /etc/doas.d/doas.conf \
|
||||||
|
&& chmod 600 /etc/doas.d/doas.conf \
|
||||||
|
&& printf 'cuteuser\ncuteuser\n' | adduser -h /home/kawaii -s /bin/ash -G wheel kawaii \
|
||||||
|
&& adduser kawaii abuild
|
||||||
|
|
||||||
|
# abuild only works as normal user
|
||||||
|
USER kawaii
|
||||||
|
WORKDIR /home/kawaii
|
||||||
|
|
||||||
|
# Tell abuild-keygen to use doas
|
||||||
|
ENV SUDO=doas
|
||||||
|
|
||||||
|
RUN git clone --depth 1 https://gitlab.alpinelinux.org/alpine/aports.git \
|
||||||
|
&& printf "\n" | abuild-keygen -a -i
|
||||||
|
|
||||||
|
CMD ["/bin/ash"]
|
|
@ -0,0 +1,10 @@
|
||||||
|
---
|
||||||
|
- name: Build OCI images for personal usage
|
||||||
|
hosts: all
|
||||||
|
gather_facts: yes
|
||||||
|
tasks:
|
||||||
|
- name: aports | Build the container image
|
||||||
|
tags: aports
|
||||||
|
podman_image:
|
||||||
|
name: aports
|
||||||
|
path: container_images/aports
|
|
@ -1,6 +1,7 @@
|
||||||
---
|
---
|
||||||
# 'ansible', 'doas' and 1 ssh client are probably already installed
|
# 'ansible', 'doas' and 1 ssh client are probably already installed
|
||||||
- hosts: all
|
- name: Install packages
|
||||||
|
hosts: all
|
||||||
gather_facts: yes
|
gather_facts: yes
|
||||||
tasks:
|
tasks:
|
||||||
- block:
|
- block:
|
||||||
|
|
|
@ -1,19 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# Super stupid and lazy way to chroot
|
|
||||||
|
|
||||||
chroot_dir="$HOME/Alpine-chroot"
|
|
||||||
|
|
||||||
# Pre
|
|
||||||
doas mount -o bind /dev ${chroot_dir}/dev
|
|
||||||
doas mount -t proc none ${chroot_dir}/proc
|
|
||||||
doas mount -o bind /sys ${chroot_dir}/sys
|
|
||||||
doas cp -L /etc/resolv.conf ${chroot_dir}/etc/
|
|
||||||
|
|
||||||
# chroot
|
|
||||||
doas chroot ${chroot_dir} /bin/ash -l
|
|
||||||
|
|
||||||
# Post
|
|
||||||
doas umount -l ${chroot_dir}/dev
|
|
||||||
doas umount -l ${chroot_dir}/proc
|
|
||||||
doas umount -l ${chroot_dir}/sys
|
|
Loading…
Reference in New Issue