forked from seapath/build_debian_iso
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_iso.sh
executable file
·41 lines (31 loc) · 1.56 KB
/
build_iso.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
35
36
37
38
39
40
41
#!/bin/bash
wd=$(dirname $0)
#docker-compose -f $wd/docker-compose.yml run --rm fai-setup bash -c "rm -rf /ext/*"
# removing the volume in case it exists from a precedent build operation
docker rm -f fai-setup 2>/dev/null
docker volume rm build_debian_iso_ext 2>/dev/null
# creating the NFSROOT
docker-compose -f $wd/docker-compose.yml run --rm fai-setup bash -c "fai-setup -v -e; rm -f /ext/srv/fai/config/class/*.profile"
# Starting the container to add stuff in it
docker-compose -f $wd/docker-compose.yml up --no-start fai-setup
# Adding the SEAPATH workspace
docker cp $wd/srv_fai_config/. fai-setup:/ext/srv/fai/config/
# Adding the php:apache docker image
docker pull php:apache
mkdir -p /tmp/php_image/opt/php_apache.tgz
docker save php:apache | gzip > /tmp/php_image/opt/php_apache.tgz/SEAPATH
echo docker cp /tmp/php_image/. fai-setup:/ext/src/fai/files/
docker cp /tmp/php_image/. fai-setup:/ext/srv/fai/config/files/
rm -rf /tmp/php_image/
# Stopping the container after having added stuff in it
docker-compose -f $wd/docker-compose.yml down
# Creating the mirror
docker-compose -f $wd/docker-compose.yml run --rm fai-setup fai-mirror -c DEBIAN,SEAPATH_LVM,FAIBASE,DEMO,SEAPATH,SEAPATH_NOLVM,GRUB_EFI /ext/mirror
# Creating the ISO
docker-compose -f $wd/docker-compose.yml run --rm fai-cd fai-cd -f -m /ext/mirror /ext/seapath.iso
# Retrieving the ISO from the volume
docker-compose -f $wd/docker-compose.yml up --no-start fai-setup
docker cp fai-setup:/ext/seapath.iso .
docker-compose -f $wd/docker-compose.yml down
# Removing the volume
docker volume rm build_debian_iso_ext