Browse Source

initial commit

master
Stefan Reimer 2 months ago
parent
commit
444abfa01f
  1. 21
      Dockerfile
  2. 23
      Makefile
  3. 17
      abuilder

21
Dockerfile

@ -0,0 +1,21 @@
ARG version="3.14"
FROM alpine:${version}
ARG version
ARG ALPINE="v${version}"
# echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories && \
RUN echo "http://dl-cdn.alpinelinux.org/alpine/${ALPINE}/main" > /etc/apk/repositories && \
echo "http://dl-cdn.alpinelinux.org/alpine/${ALPINE}/community" >> /etc/apk/repositories && \
apk -U add alpine-sdk sudo pigz && \
adduser -D alpine && \
addgroup alpine abuild && \
echo "alpine ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers && \
install -d -g abuild -m 775 /var/cache/distfiles && \
install -d -g abuild -m 775 /packages
COPY abuilder /usr/bin/
WORKDIR /home/alpine/work
USER alpine
ENTRYPOINT ["abuilder"]

23
Makefile

@ -0,0 +1,23 @@
VERSION ?= 3.14
REGISTRY := public.ecr.aws/zero-downtime
REPOSITORY := alpine-builder
TAG := $(REPOSITORY):$(VERSION)
.PHONY: build clean scan
all: clean build scan
build:
podman build --rm --squash-all --build-arg version=$(VERSION) -t $(TAG) .
push:
aws ecr-public get-login-password --region us-east-1 | podman login --username AWS --password-stdin $(REGISTRY)
podman tag $(TAG) $(REGISTRY)/$(TAG)
podman push $(REGISTRY)/$(TAG)
clean:
podman rmi -f $(TAG)
scan:
podman system service&
sleep 5; trivy $(TAG)

17
abuilder

@ -0,0 +1,17 @@
#!/bin/sh
set -e
if [ -d ~/.abuild ]; then
sudo cp ~/.abuild/*.rsa.pub /etc/apk/keys/
fi
sudo chown -R alpine:abuild ~/packages /var/cache/distfiles ~/work ~/.abuild
if [ "$1" == 'sh' ]; then
sh
else
for pkg in *; do
cd $pkg && abuild -r && cd -
done
fi
Loading…
Cancel
Save