aboutsummaryrefslogtreecommitdiff
path: root/examples/example3/example3.sh
blob: b1676a4c9a7caa5b632bd946b146080d15c21a07 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/env bash
# vim: set filetype=sh
#
# Author: Cody Hiar
# Date: 2019-01-15
#
# Description: Show how to build image, then run
# it.
#
# 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

# Build the image
docker build -t vim_image .

# Run the image
docker run --rm -it -v "$(pwd)":/usr/src/app vim_image /bin/bash -c vim