aboutsummaryrefslogtreecommitdiff
path: root/examples/example5.sh
diff options
context:
space:
mode:
Diffstat (limited to 'examples/example5.sh')
-rwxr-xr-xexamples/example5.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/examples/example5.sh b/examples/example5.sh
new file mode 100755
index 0000000..aaaff17
--- /dev/null
+++ b/examples/example5.sh
@@ -0,0 +1,28 @@
+#!/usr/bin/env bash
+# vim: set filetype=sh
+#
+# Author: Cody Hiar
+# Date: 2019-01-15
+#
+# Description: How to run chrom containized
+#
+# 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
+
+# Error with container opening socket
+# https://github.com/jessfraz/dockerfiles/issues/4
+xhost local:root
+
+# Launch spotify in a container
+docker run -it \
+ --rm \
+ -v /tmp/.X11-unix:/tmp/.X11-unix \
+ -e DISPLAY=unix"$DISPLAY" \
+ --device /dev/snd \
+ --name spotify \
+ jess/spotify