-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·43 lines (38 loc) · 816 Bytes
/
build.sh
File metadata and controls
executable file
·43 lines (38 loc) · 816 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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/env bash
set -e
# basedir
BASEDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
WORKINGDIR="$(pwd)"
CONTAINER_NAME="bootloader-syslinux"
# create environment
docker build \
-t ${CONTAINER_NAME} \
. \
&& {
echo "build environment ready"
} || {
echo "cannot create build environment"
exit 1
}
# container already exists ?
docker container rm ${CONTAINER_NAME}-env && {
echo "existing build environment removed"
} || {
echo "cannot remove build environment"
}
# create image
docker run \
--privileged=true \
--volume /dev:/dev \
--name ${CONTAINER_NAME}-env \
--tty \
--interactive \
--volume ${BASEDIR}/dist:/tmp/dist \
--rm \
${CONTAINER_NAME} \
&& {
echo "image created"
} || {
echo "ERROR: image creation failed"
exit 3
}