Problem
You need a base image of Arch Linux that you're sure is a-okay.
Compounding Factors
- Base images currently can't be so-called 'Trusted Builds' built by the repository itself. You have no way of verifying the integrity of the images available.
- Arch is very much a moving target distribution. Any images you do pull are likely to be out of date.
- You don't have an existing Arch Linux install, which the current scripts require. and don't want to make one, or use someone else's container or install to build your image, again, going back to trust.
- The Arch Netinstall ISO doesn't have enough disposable storage to run the current scripts.
Solution
Dependencies
You'll need:
gpg
curl
docker
Get an Arch Chroot
On any 64-bit Linux 2.6.23 or later you can create your base image via a chroot.
# Make some space
# Get the Image
VERSION=
# Pull Pierre Schmitz PGP Key.
# http://pgp.mit.edu:11371/pks/lookup?op=vindex&fingerprint=on&exact=on&search=0x4AA4767BBC9C4B1D18AE28B77F2D434B9741E8AC
# Verify its integrity.
Check the output, make sure the signature is good. You'll likely see a trust warning, that's fine, you didn't mark the key trusted.
Getting In
# Extract
# Hop in
You should notice you shell looks like sh-4.3#
. Furthermore, pacman
should be available.
Setup
In the chroot:
# Setup a mirror.
# Setup Keys
# Base without the following packages, to save space.
# linux jfsutils lvm2 cryptsetup groff man-db man-pages mdadm pciutils pcmciautils reiserfsprogs s-nail xfsprogs vi
# Pacman doesn't let us force ignore files, so clean up.
# Install stuff
Outside of the chroot (You may need to be root):
# udev doesnt work in containers, rebuild /dev
# Taken from https://raw.githubusercontent.com/dotcloud/docker/master/contrib/mkimage-arch.sh
DEV=root.x86_64/dev
Import the Image
Outside of the chroot (You may need to be root):
USER='hoverbear'
|
Test It
Give it a try!
A full, start to end script
You can grab a fully automated script here.