-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-container.sh
executable file
·35 lines (22 loc) · 1.25 KB
/
build-container.sh
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
#!/bin/bash
FEDORA_RELEASE=30
FEDORA_IMAGE=registry.fedoraproject.org/fedora-minimal:${FEDORA_RELEASE}
TOOLCHAIN_ARCHIVE=sonnet-toolchain-20190404.tar.gz
TOOLCHAIN_URL=http://assets.sakura-it.pl/binaries/${TOOLCHAIN_ARCHIVE}
container=$(buildah from ${FEDORA_IMAGE})
DNF_TOOL=microdnf
RPMFUSION_RPMS="https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-${FEDORA_RELEASE}.noarch.rpm https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-${FEDORA_RELEASE}.noarch.rpm"
buildah copy $container ${RPMFUSION_RPMS} /root/
buildah run $container -- rpm -ivh /root/*rpm
buildah run $container -- $DNF_TOOL -y install make lha tar
buildah run $container -- $DNF_TOOL clean all
buildah add $container ${TOOLCHAIN_URL} /opt/
buildah run $container -- tar zxf /opt/${TOOLCHAIN_ARCHIVE} -C /opt/
buildah run $container -- rm /opt/${TOOLCHAIN_ARCHIVE}
buildah run $container -- ln -s /opt/sonnet-toolchain /opt/amiga-cross
buildah run $container -- mkdir /build
buildah config --volume /build $container
buildah add $container entrypoint.sh /
buildah config --entrypoint /entrypoint.sh $container
buildah config --label maintainer="Radosław Kujawa <[email protected]>" $container
buildah commit $container sonnetamiga-builder:latest