-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·28 lines (23 loc) · 811 Bytes
/
Copy pathbuild.sh
File metadata and controls
executable file
·28 lines (23 loc) · 811 Bytes
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
#!/bin/bash
source common.sh
for build in $builds; do
dockerName="$namespace--$build"
docker build -t $dockerName \
-f "$HOST_RECIPEDIR/$build.dockerfile" .
# Docker needs for the container to be running in order to copy things from
# the image itself
docker rm -f $dockerName &>/dev/null || true # Remove old instance
docker run \
-d \
--name $dockerName \
$dockerName \
/bin/bash \
/docker-entrypoint.sh
# Contents will be merged with previous builds
mkdir -p "$HOST_OBJDIR/RPMS"
docker cp "$dockerName:$DOCKER_OBJPREFIX/RPMS" "$HOST_OBJDIR/"
mkdir -p "$HOST_OBJDIR/SRPMS"
docker cp "$dockerName:$DOCKER_OBJPREFIX/SRPMS" "$HOST_OBJDIR/"
# Delete the instance (not the image)
docker kill $dockerName
done