docker-archlinux-daily/pacstrap-docker
Stefan Agner 8dfabe4056 initial commit
Create Arch Linux ARM images using multi-stage Dockerfile. This
works well with binfmt emulation and allows to generate images
from scratch.

Inspiration taken from:
- https://github.com/archlinux/archlinux-docker
- https://github.com/lopsided98/archlinux
2019-01-23 00:31:17 +01:00

18 lines
537 B
Bash
Executable file

#!/bin/bash
(( $# )) || die "No root directory specified"
newroot=$1; shift
pacman_args=("${@:-base}")
[[ -d $newroot ]] || die "%s is not a directory" "$newroot"
echo 'Creating install root at %s' "$newroot"
mkdir -m 0755 -p "$newroot"/var/{cache/pacman/pkg,lib/pacman,log} "$newroot"/{dev,run,etc}
mkdir -m 1777 -p "$newroot"/tmp
mkdir -m 0555 -p "$newroot"/{sys,proc}
echo 'Installing packages to %s' "$newroot"
if ! pacman -r "$newroot" -Sy --noconfirm "${pacman_args[@]}"; then
die 'Failed to install packages to new root'
fi