-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdocker-run.sh
More file actions
executable file
·28 lines (22 loc) · 882 Bytes
/
Copy pathdocker-run.sh
File metadata and controls
executable file
·28 lines (22 loc) · 882 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env bash
# Please Use Google Shell Style: https://google.github.io/styleguide/shell.xml
# ---- Start unofficial bash strict mode boilerplate
# http://redsymbol.net/articles/unofficial-bash-strict-mode/
set -o errexit # always exit on error
set -o errtrace # trap errors in functions as well
set -o pipefail # don't ignore exit codes when piping output
set -o posix # more strict failures in subshells
# set -x # enable debugging
IFS="$(printf "\n\t")"
# ---- End unofficial bash strict mode boilerplate
cd "$(dirname "${BASH_SOURCE[0]}")/.."
tag="$(basename "${PWD}")"
if ! docker inspect "${tag}" &>/dev/null; then
./bin/docker-build.sh
fi
exec docker run --rm --interactive --tty \
--attach stdin --attach stdout --attach stderr \
--volume "${PWD}:/opt" \
--publish "127.0.0.1:9229:9229" \
--user "${USER}" \
"${tag}" "${1-bash}"