forked from fedora-cloud/docker-brew-fedora
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuildcontainers.sh
More file actions
executable file
·44 lines (33 loc) · 1.14 KB
/
buildcontainers.sh
File metadata and controls
executable file
·44 lines (33 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
set -xe
VERSION="25"
MINORVER="1.3"
MINORVER_DOCKERTAG="1-3"
VERSIONWORD="twenty-five"
IMAGE="Fedora-Minimal-armhfp-$VERSION-$MINORVER-sda.raw"
URLBASE="https://download.fedoraproject.org/pub/fedora/linux/releases/$VERSION/Spins/armhfp/images/"
# Fetching & uncompress release
if [ ! -f $IMAGE ]; then
wget -c $URLBASE$IMAGE.xz
unxz -v -k $IMAGE.xz
fi
LOOPDEV=`losetup -P --show -f $IMAGE`
if [ "x$?" != "x0" ]; then
echo "Could not create loopback device for $IMAGE" >&2
exit 1
fi
ROOTVOL=$(blkid -t LABEL="_/" -o device | grep ^/dev/loop101p)
if [ "x$?" != "x0" ]; then
echo "There was no volume with label "_/" in $IMAGE" >&2
losetup -d $LOOPDEV
exit 1
fi
TMPDIR=`mktemp -d`
mount $ROOTVOL $TMPDIR
tar -C $TMPDIR -Jcf fedora-$VERSION-minimal.tar.xz .
umount $TMPDIR
losetup -d $LOOPDEV
docker build -t armbuild/fedora-qcow-minimal:$VERSION .
docker tag armbuild/fedora-qcow-minimal:$VERSION armbuild/fedora-qcow-minimal:latest
docker tag armbuild/fedora-qcow-minimal:$VERSION armbuild/fedora-qcow-minimal:$VERSIONWORD
docker tag armbuild/fedora-qcow-minimal:$VERSION armbuild/fedora-qcow-minimal:$VERSION-$MINORVER_DOCKERTAG