aboutsummaryrefslogtreecommitdiffstats
path: root/rpm-local/shell.sh
blob: 5fd4a8e1da08e1c6a43f60511687019f1cffa2e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh -ex
DIR="$(cd "$(dirname "$0")" && pwd -P)"
IMAGE="centos8"

if ! [ -e ".build.docker.$IMAGE" ]; then
	echo "ERROR: run build.sh first, to generate the docker img"
	exit 1
fi


docker run \
	-it \
	--rm \
	-v "$DIR/rpmbuild:/home/user/rpmbuild" \
	-v "$DIR/scripts:/scripts" \
	-v "$DIR/cache/$IMAGE/dnf:/var/cache/dnf" \
	-v "$DIR/cache/yum_repos:/root/yum_repos" \
	-v "$DIR/cache/distfiles:/home/user/distfiles" \
	"$IMAGE:latest" \
	bash