aboutsummaryrefslogtreecommitdiff
path: root/examples/example1.sh
diff options
context:
space:
mode:
Diffstat (limited to 'examples/example1.sh')
-rwxr-xr-xexamples/example1.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/examples/example1.sh b/examples/example1.sh
new file mode 100755
index 0000000..d441d9a
--- /dev/null
+++ b/examples/example1.sh
@@ -0,0 +1,22 @@
+#!/usr/bin/env bash
+# vim: set filetype=sh
+#
+# Author: Cody Hiar
+# Date: 2019-01-15
+#
+# Description: Show how quickly a docker container
+# can boot up, run a command, and then boot down.
+#
+# Set options:
+# e: Stop script if command fails
+# u: Stop script if unset variable is referenced
+# x: Debug, print commands as they are executed
+# o pipefail: If any command in a pipeline fails it all fails
+#
+set -exuo pipefail
+
+# Run a container
+time docker run --rm -it ubuntu:18.04 /bin/bash -c 'echo Hello World'
+
+# Show size of docker container
+docker images | grep '18.04'