-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
...based on f37, not f31. And make it fedora-minimal so it's smaller. And clean up dnf so it's even smaller. And tag it with our proper YMD tag, and commit the script that builds it. This broke the system-df tests. In the process of resolving that, I found those tests a little lacking. So, improve their coverage a little bit. Signed-off-by: Ed Santiago <[email protected]>
- Loading branch information
1 parent
aff0182
commit 16b595c
Showing
5 changed files
with
139 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
#!/bin/bash | ||
# | ||
# build-systemd-image - script for producing a test image with systemd | ||
# | ||
# Based on the build-testimage script. This script builds a fedora-based | ||
# image with systemd in it, for use in systemd-based tests. | ||
# | ||
|
||
# Podman binary to use | ||
PODMAN=${PODMAN:-$(pwd)/bin/podman} | ||
|
||
# Tag for this new image | ||
YMD=$(date +%Y%m%d) | ||
|
||
# git-relative path to this script | ||
create_script=$(cd $(dirname $0) && git ls-files --full-name $(basename $0)) | ||
if [ -z "$create_script" ]; then | ||
create_script=$0 | ||
fi | ||
|
||
# Creation timestamp, Zulu time | ||
create_time_t=$(date +%s) | ||
create_time_z=$(env TZ=UTC date --date=@$create_time_t +'%Y-%m-%dT%H:%M:%SZ') | ||
|
||
set -ex | ||
|
||
# We'll need to create a Containerfile plus various other files to add in | ||
tmpdir=$(mktemp -t -d $(basename $0).tmp.XXXXXXX) | ||
cd $tmpdir | ||
echo $YMD >testimage-id | ||
|
||
cat >Containerfile <<EOF | ||
FROM registry.fedoraproject.org/fedora-minimal:37 | ||
LABEL created_by=$create_script | ||
LABEL created_at=$create_time_z | ||
RUN microdnf install -y systemd && microdnf clean all | ||
ADD testimage-id /home/podman/ | ||
WORKDIR /home/podman | ||
CMD ["/bin/echo", "This image is intended for podman CI testing"] | ||
EOF | ||
|
||
# Start from scratch | ||
testimg_base=quay.io/libpod/systemd-image | ||
testimg=${testimg_base}:$YMD | ||
$PODMAN rmi -f $testimg &> /dev/null || true | ||
|
||
# Arch emulation on Fedora requires the qemu-user-static package. | ||
for arch in amd64 arm64 ppc64le s390x;do | ||
$PODMAN build \ | ||
--arch=$arch \ | ||
--squash-all \ | ||
--timestamp=$create_time_t \ | ||
--manifest=$testimg \ | ||
. | ||
done | ||
|
||
# Clean up | ||
cd /tmp | ||
rm -rf $tmpdir | ||
|
||
# Tag image and push (all arches) to quay. | ||
cat <<EOF | ||
If you're happy with this image, run: | ||
podman manifest push --all ${testimg} docker://${testimg} | ||
EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters