3
# build-systemd-image - script for producing a test image with systemd
5
# Based on the build-testimage script. This script builds a fedora-based
6
# image with systemd in it, for use in systemd-based tests.
10
PODMAN=${PODMAN:-$(pwd)/bin/podman}
12
# Tag for this new image
15
# git-relative path to this script
16
create_script=$(cd $(dirname $0) && git ls-files --full-name $(basename $0))
17
if [ -z "$create_script" ]; then
20
create_script_rev=$(git describe --tags)
22
# Creation timestamp, Zulu time
23
create_time_t=$(date +%s)
24
create_time_z=$(env TZ=UTC date --date=@$create_time_t +'%Y-%m-%dT%H:%M:%SZ')
28
# We'll need to create a Containerfile plus various other files to add in
29
tmpdir=$(mktemp -t -d $(basename $0).tmp.XXXXXXX)
31
echo $YMD >testimage-id
33
cat >Containerfile <<EOF
34
FROM registry.fedoraproject.org/fedora-minimal:39
35
LABEL created_by="$create_script @ $create_script_rev"
36
LABEL created_at=$create_time_z
37
RUN microdnf install -y systemd tzdata && microdnf clean all && sed -i -e 's/.*LogColor.*/LogColor=no/' /etc/systemd/system.conf
38
ADD testimage-id /home/podman/
40
CMD ["/bin/echo", "This image is intended for podman CI testing"]
44
testimg_base=quay.io/libpod/systemd-image
45
testimg=${testimg_base}:$YMD
46
$PODMAN manifest rm $testimg &> /dev/null || true
47
$PODMAN rmi -f $testimg &> /dev/null || true
49
# Arch emulation on Fedora requires the qemu-user-static package.
50
declare -a arches=(amd64 arm64 ppc64le s390x)
53
while [[ $i -lt $n_arches ]]; do
57
echo "Building: $arch ($i of $n_arches)"
61
--timestamp=$create_time_t \
70
# Tag image and push (all arches) to quay.
73
If you're happy with this image, run:
75
podman manifest push --all ${testimg} docker://${testimg}