]> git.ipfire.org Git - people/jschlag/pbs-docker.git/blobdiff - src/pbs-base/build.sh
Refactoring the structure of our images
[people/jschlag/pbs-docker.git] / src / pbs-base / build.sh
diff --git a/src/pbs-base/build.sh b/src/pbs-base/build.sh
new file mode 100755 (executable)
index 0000000..31db576
--- /dev/null
@@ -0,0 +1,37 @@
+#!/bin/bash
+. /usr/lib/docker-shell-scripts-lib/tag.sh
+. /usr/lib/docker-shell-scripts-lib/get-id.sh
+. /usr/lib/docker-shell-scripts-lib/preparation.sh
+. /usr/lib/docker-shell-scripts-lib/logging.sh
+. /usr/lib/docker-shell-scripts-lib/install.sh
+
+###
+### Build the pakfire Dockerimage
+###
+
+### preparation ###
+# cd into script dir
+(cd $(dirname -- "$(readlink -e -- "$BASH_SOURCE")") || exit
+
+# check for all necessary files
+
+CheckForFile "setup-org.sh"
+CheckForFile "Dockerfile"
+
+#create a work copy of setup.sh
+cp setup-org.sh setup.sh
+### paramter for mariadb build
+repo="ipfire-pbs-base"
+dockertag="new"
+username=jonatanschlag
+tag="${username}/${repo}:${dockertag}"
+### Build the docker image
+docker build --no-cache=true -t "$tag" .
+### Tag the docker image
+back=$(tag-image "${username}/${repo}")
+
+if [ "error" = "$back" ]; then
+        echo "Tagging was not successful"
+fi
+rm -f setup.sh
+)