-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathbuild-theia.sh
More file actions
executable file
·32 lines (25 loc) · 922 Bytes
/
build-theia.sh
File metadata and controls
executable file
·32 lines (25 loc) · 922 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
#!/bin/bash
LOCK=/tmp/$(basename $0 .sh).lck
exit_with () {
[ "$2" != "" ] && echo -e $2 >&2
rm -f $LOCK
exit ${1:-0}
}
[ "$1" = "--help" ] && exit_with 1 "\nUsage: \e[1m$(basename $0)\e[0m\n"
trap "rm -f $LOCK" TERM INT QUIT HUP
[ -f $LOCK ] && exit_with 2 "A build process is in process since $(cat $LOCK)"
date > $LOCK
REGISTRY=registry.simplicite.io
IMG=$REGISTRY/theia:latest
echo "========================================================"
echo "Building $IMG image..."
echo "========================================================"
DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
FROM=$(grep '^FROM' Dockerfile | awk '{ print $2 }')
docker pull $FROM
docker build --network host -f theia/Dockerfile -t $IMG --build-arg THEIA_TAG=$TAG --build-arg BUILD_DATE=$DATE . || exit_with 3 "Unable to build image $IMG"
echo "Done"
echo ""
echo "docker run -it --rm -p 127.0.0.1:3030:3030 --name=theia $IMG"
echo ""
exit_with