This is Arch Linux Docker base image build setup that employs the bootstrap tarball distributed by distro authors.
It's meant to provide an easy to use solution for building Arch Linux Docker images on non-Arch Linux hosts (and as an unprivileged user if your Docker instance allows that, but please mind there are good reasons why it shouldn't).
-
git clone
this repository. -
cd
to a directory where you have cloned it. -
Download an
archlinux-bootstrap-date-architecture.tar.gz
archive there, preferably the newest one (or expect a longerpacman -Syu
run atdocker build
, and, if your tarball is relatively old, some incompatibilities to manifest; Arch changes fast). From my experience, https://archive.archlinux.org/iso/ is a very fast mirror, but you may want to choose your preferred one on https://www.archlinux.org/download/. -
Run
./tar_fix.py --input=archlinux-bootstrap-date-architecture.tar.gz --output=bootstrap.tar.gz
. This will remove input tarball's top-level directory from all its component paths, and save that in the output tarball. As a result its content starts at/
rather thanx86_64/
ori686/
, and so will the filesystem of the Docker image.tar_fix.py
needs Python 3.5. It will fail with Python 2, and even with 3.4, like in issue #1. -
Make sure you have my
Dockerfile
,.dockerignore
and thebootstrap.tar.gz
in one directory. -
Build the image with a command like
docker build --build-arg architecture=x86_64 --tag archlinux-x86_64-base .
. Mind the dot! Use--build-arg architecture=i686
if you are building from an i686bootstrap.tar.gz
.
Discussion: https://bbs.archlinux.org/viewtopic.php?pid=1667108#p1667108.