summaryrefslogtreecommitdiff
path: root/share/spack/packages/build-image.sh
diff options
context:
space:
mode:
Diffstat (limited to 'share/spack/packages/build-image.sh')
-rwxr-xr-xshare/spack/packages/build-image.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/share/spack/packages/build-image.sh b/share/spack/packages/build-image.sh
new file mode 100755
index 0000000000..c068d11715
--- /dev/null
+++ b/share/spack/packages/build-image.sh
@@ -0,0 +1,17 @@
+#!/usr/bin/env bash
+#
+# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
+# Spack Project Developers. See the top-level COPYRIGHT file for details.
+#
+# SPDX-License-Identifier: (Apache-2.0 OR MIT)
+
+script="$( basename "$0" )"
+cd "$( dirname "$0" )"
+
+export IMAGE="spack/packages.spack.io:latest"
+
+if [ "$script" '=' 'push-image.sh' ] ; then
+ docker push "${IMAGE}"
+else
+ docker build -f -t "${IMAGE}" .
+fi