aboutsummaryrefslogtreecommitdiff
path: root/setup/docker/build.sh
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-06-10 11:49:27 +1200
committerGitHub <noreply@github.com>2016-06-10 11:49:27 +1200
commite966778c43ee4a2fa12705cded8648b96ef78f61 (patch)
treee86f297ff8110ac7bd5800643c7067ff9d40a242 /setup/docker/build.sh
parent5a2c64cd99134e98e311d694a76d3d22703496c2 (diff)
parent049bab3bdb25acdf4f0c8cf4eb8cad200b860066 (diff)
downloadtrackermap-server-e966778c43ee4a2fa12705cded8648b96ef78f61.tar.gz
trackermap-server-e966778c43ee4a2fa12705cded8648b96ef78f61.tar.bz2
trackermap-server-e966778c43ee4a2fa12705cded8648b96ef78f61.zip
Merge pull request #2009 from drecchia/master-docker
Official Docker build script
Diffstat (limited to 'setup/docker/build.sh')
-rw-r--r--setup/docker/build.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/setup/docker/build.sh b/setup/docker/build.sh
new file mode 100644
index 000000000..31ee60a03
--- /dev/null
+++ b/setup/docker/build.sh
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+which mvn &> /dev/null || { echo >&2 "Maven package cant be found on path. Aborting."; exit 1; }
+which awk &> /dev/null || { echo >&2 "Awk package cant be found on path. Aborting."; exit 1; }
+which docker &> /dev/null || { echo >&2 "Docker package cant be found on path. Aborting."; exit 1; }
+mvn package || { echo >&2 "Maven package has failed. Aborting."; exit 1; }
+
+export company="tananaev"
+export software="traccar"
+export version=$(head -n 10 ./pom.xml |grep version|cut -d ">" -f2|cut -d"<" -f1)
+
+tmp="./setup/docker/tmp"
+
+mkdir -p ${tmp}
+
+cat ./setup/unix/traccar.xml | awk '/web.path/ && !modif { printf(" <entry key=\"web.debug\">true</entry>\n"); modif=1 } {print}' > ${tmp}/traccar.xml
+cp -rf ./schema ${tmp}/schema
+cp -rf ./target/tracker-server.jar ${tmp}/traccar-server.jar
+cp -rf ./target/lib ${tmp}/lib
+cp -rf ./web ${tmp}/web
+
+docker build -t ${company}/${software}:${version} ./setup/docker/
+
+rm -rf ${tmp} \ No newline at end of file