Verified Commit fea811aa authored by Dom Sekotill's avatar Dom Sekotill
Browse files

Add http-host script

parent c1eadec6
Loading
Loading
Loading
Loading

.bin/http-host

0 → 100755
+12 −0
Original line number Diff line number Diff line
#!/bin/bash
die() { echo >&2 "Fatal: $*"; exit 2; }
set -eu
declare -a opts
declare -i port
test ${port:=${1? A port number is required}} -gt 0 &&
	opts+=(--publish $port:80) ||
	die "invalid port: $1"
while shift && let $#; do
	opts+=(--volume $(realpath -e "${1%%:*}")":/usr/share/nginx/html/${1#*:}")
done
exec docker run "${opts[@]}" nginx